From 7c36154b36d44a49853ae1075efecf9e775df12d Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Wed, 19 Jun 2024 05:59:48 -0400 Subject: [PATCH] drive by fix for some clippy warnings --- src/id.rs | 2 +- src/routes.rs | 2 +- src/update.rs | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/id.rs b/src/id.rs index 2249aface..287f520d7 100644 --- a/src/id.rs +++ b/src/id.rs @@ -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 diff --git a/src/routes.rs b/src/routes.rs index d8e663c10..655b43fe4 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -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) } diff --git a/src/update.rs b/src/update.rs index de6baa42f..e8f5f7e12 100644 --- a/src/update.rs +++ b/src/update.rs @@ -55,6 +55,8 @@ pub mod helper { /// /// Impl will fulfill the postconditions of `maybe_update` pub unsafe trait Fallback { + /// # Safety + /// /// Same safety conditions as `Update::maybe_update` unsafe fn maybe_update(old_pointer: *mut T, new_value: T) -> bool; }