Skip to content

Commit

Permalink
cleanup: replace &(*x) with x.as_ref() for smart pointer derefs
Browse files Browse the repository at this point in the history
  • Loading branch information
ziyak97 authored Dec 19, 2024
1 parent dbe6b8d commit 99d1b0e
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bindings/wasm/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ impl DatabaseStorage {

impl limbo_core::DatabaseStorage for DatabaseStorage {
fn read_page(&self, page_idx: usize, c: Rc<limbo_core::Completion>) -> Result<()> {
let r = match &(*c) {
let r = match c.as_ref() {
limbo_core::Completion::Read(r) => r,
_ => unreachable!(),
};
Expand Down
2 changes: 1 addition & 1 deletion core/io/darwin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ impl File for DarwinFile {
fn pread(&self, pos: usize, c: Rc<Completion>) -> Result<()> {
let file = self.file.borrow();
let result = {
let r = match &(*c) {
let r = match c.as_ref() {
Completion::Read(r) => r,
_ => unreachable!(),
};
Expand Down
2 changes: 1 addition & 1 deletion core/io/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(),
};
Expand Down
2 changes: 1 addition & 1 deletion core/io/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ impl File for LinuxFile {
}

fn pread(&self, pos: usize, c: Rc<Completion>) -> Result<()> {
let r = match &(*c) {
let r = match c.as_ref() {
Completion::Read(r) => r,
_ => unreachable!(),
};
Expand Down
2 changes: 1 addition & 1 deletion core/io/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(),
};
Expand Down
2 changes: 1 addition & 1 deletion core/storage/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub struct FileStorage {
#[cfg(feature = "fs")]
impl DatabaseStorage for FileStorage {
fn read_page(&self, page_idx: usize, c: Rc<Completion>) -> Result<()> {
let r = match &(*c) {
let r = match c.as_ref() {
Completion::Read(r) => r,
_ => unreachable!(),
};
Expand Down

0 comments on commit 99d1b0e

Please sign in to comment.