Implement some From traits for text_input::Id

This commit is contained in:
Héctor Ramón Jiménez 2024-09-18 20:30:14 +02:00
parent f897442831
commit 1448c5bfa5
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
5 changed files with 38 additions and 23 deletions

View file

@ -1,5 +1,5 @@
use std::fmt;
use std::hash::Hash;
use std::sync::atomic::{self, AtomicU64};
/// The id of the window.
@ -14,3 +14,9 @@ impl Id {
Id(COUNT.fetch_add(1, atomic::Ordering::Relaxed))
}
}
impl fmt::Display for Id {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
self.0.fmt(f)
}
}