Skip to content

Commit

Permalink
Merge branch 'multipattern-explain' of github.com:eytans/easter-egg i…
Browse files Browse the repository at this point in the history
…nto multipattern-explain
  • Loading branch information
eytans committed Oct 21, 2024
2 parents 5bcf587 + ce48c5a commit c29b667
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,30 @@ impl From<Id> for usize {
}
}

impl Into<u32> for Id {
fn into(self) -> u32 {
self.0
}
}

impl Into<usize> for Id {
fn into(self) -> usize {
self.0 as usize
}
}

impl Into<u32> for &Id {
fn into(self) -> u32 {
self.0
}
}

impl Into<usize> for &Id {
fn into(self) -> usize {
self.0 as usize
}
}

impl std::fmt::Debug for Id {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.0)
Expand Down

0 comments on commit c29b667

Please sign in to comment.