Impl Id convert methods

This commit is contained in:
micialware committed 2026-08-31 11:21:01 +03:00
1 parent 97e301b0d6
commit ba834ac9b1
3 files changed
+22 -10

No files matched your search

+12
View File
@@ -68,3 +68,15 @@ macro_rules! id_impl {
id_impl!(u32, Id, INVALID_ID);
id_impl!(u16, SmallId, INVALID_SMALL_ID);
impl From<SmallId> for Id {
fn from(value: SmallId) -> Self {
Self(value.0 as u32)
}
}
impl From<Id> for SmallId {
fn from(value: Id) -> Self {
Self(value.0 as u16)
}
}