From 99d1b0e5a334506e33250b9fc63e5b82ea465ba7 Mon Sep 17 00:00:00 2001 From: Ziyak Jehangir <53836911+ziyak97@users.noreply.github.com> Date: Thu, 19 Dec 2024 19:36:04 +0530 Subject: [PATCH] cleanup: replace &(*x) with x.as_ref() for smart pointer derefs --- bindings/wasm/lib.rs | 2 +- core/io/darwin.rs | 2 +- core/io/generic.rs | 2 +- core/io/linux.rs | 2 +- core/io/windows.rs | 2 +- core/storage/database.rs | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bindings/wasm/lib.rs b/bindings/wasm/lib.rs index f4c02a8e..ec2762b9 100644 --- a/bindings/wasm/lib.rs +++ b/bindings/wasm/lib.rs @@ -267,7 +267,7 @@ impl DatabaseStorage { impl limbo_core::DatabaseStorage for DatabaseStorage { fn read_page(&self, page_idx: usize, c: Rc) -> Result<()> { - let r = match &(*c) { + let r = match c.as_ref() { limbo_core::Completion::Read(r) => r, _ => unreachable!(), }; diff --git a/core/io/darwin.rs b/core/io/darwin.rs index bdab24af..c052b572 100644 --- a/core/io/darwin.rs +++ b/core/io/darwin.rs @@ -190,7 +190,7 @@ impl File for DarwinFile { fn pread(&self, pos: usize, c: Rc) -> Result<()> { let file = self.file.borrow(); let result = { - let r = match &(*c) { + let r = match c.as_ref() { Completion::Read(r) => r, _ => unreachable!(), }; diff --git a/core/io/generic.rs b/core/io/generic.rs index c8c5c45b..0c35eaf5 100644 --- a/core/io/generic.rs +++ b/core/io/generic.rs @@ -55,7 +55,7 @@ impl File for GenericFile { let mut file = self.file.borrow_mut(); file.seek(std::io::SeekFrom::Start(pos as u64))?; { - let r = match &(*c) { + let r = match c.as_ref() { Completion::Read(r) => r, _ => unreachable!(), }; diff --git a/core/io/linux.rs b/core/io/linux.rs index fde8a961..e765cc8a 100644 --- a/core/io/linux.rs +++ b/core/io/linux.rs @@ -241,7 +241,7 @@ impl File for LinuxFile { } fn pread(&self, pos: usize, c: Rc) -> Result<()> { - let r = match &(*c) { + let r = match c.as_ref() { Completion::Read(r) => r, _ => unreachable!(), }; diff --git a/core/io/windows.rs b/core/io/windows.rs index db7f9da3..8bf37a2f 100644 --- a/core/io/windows.rs +++ b/core/io/windows.rs @@ -57,7 +57,7 @@ impl File for WindowsFile { let mut file = self.file.borrow_mut(); file.seek(std::io::SeekFrom::Start(pos as u64))?; { - let r = match &(*c) { + let r = match c.as_ref() { Completion::Read(r) => r, _ => unreachable!(), }; diff --git a/core/storage/database.rs b/core/storage/database.rs index 75d83573..80a4e55c 100644 --- a/core/storage/database.rs +++ b/core/storage/database.rs @@ -25,7 +25,7 @@ pub struct FileStorage { #[cfg(feature = "fs")] impl DatabaseStorage for FileStorage { fn read_page(&self, page_idx: usize, c: Rc) -> Result<()> { - let r = match &(*c) { + let r = match c.as_ref() { Completion::Read(r) => r, _ => unreachable!(), };