drive by fix for some clippy warnings

This commit is contained in:
Niko Matsakis 2024-06-19 05:59:48 -04:00
parent 2abdd3f2d5
commit 7c36154b36
3 changed files with 4 additions and 2 deletions

View file

@ -16,7 +16,7 @@ pub struct Id {
}
impl Id {
pub const MAX_U32: u32 = std::u32::MAX - 0xFF;
pub const MAX_U32: u32 = u32::MAX - 0xFF;
pub const MAX_USIZE: usize = Self::MAX_U32 as usize;
/// Create a `salsa::Id` from a u32 value. This value should

View file

@ -11,7 +11,7 @@ pub struct IngredientIndex(u32);
impl IngredientIndex {
/// Create an ingredient index from a usize.
pub(crate) fn from(v: usize) -> Self {
assert!(v < (std::u32::MAX as usize));
assert!(v < (u32::MAX as usize));
Self(v as u32)
}

View file

@ -55,6 +55,8 @@ pub mod helper {
///
/// Impl will fulfill the postconditions of `maybe_update`
pub unsafe trait Fallback<T> {
/// # Safety
///
/// Same safety conditions as `Update::maybe_update`
unsafe fn maybe_update(old_pointer: *mut T, new_value: T) -> bool;
}