fix the remaining clippy items

This commit is contained in:
Niko Matsakis 2024-08-16 10:04:30 +03:00
parent 8b8dd53197
commit 8ad967ea1e
4 changed files with 5 additions and 4 deletions

View file

@ -109,7 +109,7 @@ where
unsafe { std::mem::transmute(data) }
}
unsafe fn from_internal_data<'db>(&'db self, data: &C::Data<'static>) -> &C::Data<'db> {
unsafe fn from_internal_data<'db>(data: &'db C::Data<'static>) -> &'db C::Data<'db> {
unsafe { std::mem::transmute(data) }
}
@ -175,7 +175,7 @@ where
/// to the interned item.
pub fn data<'db>(&'db self, db: &'db dyn Database, id: Id) -> &'db C::Data<'db> {
let internal_data = db.zalsa().table().get::<Value<C>>(id);
unsafe { self.from_internal_data(&internal_data.data) }
unsafe { Self::from_internal_data(&internal_data.data) }
}
/// Lookup the fields from an interned struct.

View file

@ -167,6 +167,7 @@ impl Table {
}
impl<T: Slot> Page<T> {
#[allow(clippy::uninit_vec)]
fn new(ingredient: IngredientIndex) -> Self {
let mut data = Vec::with_capacity(PAGE_LEN);
unsafe {

View file

@ -99,7 +99,7 @@ pub struct MemoIngredientIndex(u32);
impl MemoIngredientIndex {
pub(crate) fn from_usize(u: usize) -> Self {
assert!(u < std::u32::MAX as usize);
assert!(u < u32::MAX as usize);
MemoIngredientIndex(u as u32)
}
pub(crate) fn as_usize(self) -> usize {

View file

@ -54,7 +54,7 @@ impl ZalsaLocal {
/// Allocate a new id in `table` for the given ingredient
/// storing `value`. Remembers the most recent page from this
/// thread and attempts to reuse it.
pub(crate) fn allocate<'t, T: Slot>(
pub(crate) fn allocate<T: Slot>(
&self,
table: &Table,
ingredient: IngredientIndex,