Skip to content

Commit

Permalink
Make it easier to convert strings to Id (emilk#2350)
Browse files Browse the repository at this point in the history
  • Loading branch information
lampsitter authored and JohannesProgrammiert committed Jan 21, 2023
1 parent 474ebf0 commit 6533693
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/egui/src/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ impl From<&'static str> for Id {
}
}

impl From<String> for Id {
#[inline]
fn from(string: String) -> Self {
Self::new(string)
}
}

// ----------------------------------------------------------------------------

// Idea taken from the `nohash_hasher` crate.
Expand Down

0 comments on commit 6533693

Please sign in to comment.