diff --git a/components/salsa-2022/src/id.rs b/components/salsa-2022/src/id.rs index 20f0e6b5..2a8294cb 100644 --- a/components/salsa-2022/src/id.rs +++ b/components/salsa-2022/src/id.rs @@ -20,7 +20,7 @@ impl Id { pub const MAX_USIZE: usize = Self::MAX_U32 as usize; #[track_caller] - pub fn from_u32(x: u32) -> Self { + pub(crate) fn from_u32(x: u32) -> Self { assert!(x < Self::MAX_U32); Id { value: NonZeroU32::new(x + 1).unwrap(), @@ -32,19 +32,6 @@ impl Id { } } -impl From for Id { - fn from(n: u32) -> Self { - Id::from_u32(n) - } -} - -impl From for Id { - fn from(n: usize) -> Self { - assert!(n < Id::MAX_USIZE); - Id::from_u32(n as u32) - } -} - impl From for u32 { fn from(n: Id) -> Self { n.as_u32() diff --git a/components/salsa-2022/src/input.rs b/components/salsa-2022/src/input.rs index 12fe2f43..b61dd3ba 100644 --- a/components/salsa-2022/src/input.rs +++ b/components/salsa-2022/src/input.rs @@ -40,7 +40,7 @@ where pub fn new_input(&mut self, _runtime: &mut Runtime) -> Id { let next_id = self.counter; self.counter += 1; - Id::from_id(crate::Id::from(next_id)) + Id::from_id(crate::Id::from_u32(next_id)) } }