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!(), };