Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
jauhararifin committed Aug 27, 2024
1 parent b761020 commit b306c06
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/pager/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl Pager {
let mut evictor = self.evictor.lock();
if let Some(frame_id) = internal.page_to_frame.get(&pgid).copied() {
evictor.acquired(frame_id);
return Ok(T::get(&self.pool, txid, frame_id));
Ok(T::get(&self.pool, txid, frame_id))
} else if let Some(frame) = self.pool.alloc(txid, PageMeta::empty(pgid)) {
let mut file = self.file.write();
*frame.meta = Self::fetch_page(&mut file, pgid, frame.buffer)?;
Expand Down
6 changes: 3 additions & 3 deletions src/pager/page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ where
use super::MAXIMUM_PAGE_SIZE;
use std::cell::RefCell;
std::thread_local! {
static TEMP_BUFFER: RefCell<[u8; MAXIMUM_PAGE_SIZE]> = RefCell::new([0u8; MAXIMUM_PAGE_SIZE]);
static TEMP_BUFFER: RefCell<[u8; MAXIMUM_PAGE_SIZE]> = const { RefCell::new([0u8; MAXIMUM_PAGE_SIZE]) };
}

let kind = internal.meta.kind.interior_mut();
Expand All @@ -1058,7 +1058,7 @@ where
let count = kind.count;
let page_size = internal.buffer.len();
let copied = &mut copied[..page_size];
copied.copy_from_slice(&internal.buffer);
copied.copy_from_slice(internal.buffer);

let mut new_offset = page_size - PAGE_FOOTER_SIZE;
for i in 0..count {
Expand Down Expand Up @@ -1561,7 +1561,7 @@ where
use super::MAXIMUM_PAGE_SIZE;
use std::cell::RefCell;
std::thread_local! {
static TEMP_BUFFER: RefCell<[u8; MAXIMUM_PAGE_SIZE]> = RefCell::new([0u8; MAXIMUM_PAGE_SIZE]);
static TEMP_BUFFER: RefCell<[u8; MAXIMUM_PAGE_SIZE]> = const { RefCell::new([0u8; MAXIMUM_PAGE_SIZE]) };
}

let kind = internal.meta.kind.leaf_mut();
Expand Down

0 comments on commit b306c06

Please sign in to comment.