From d2f70cdcd1411c370718739d14a528ec6244d3fa Mon Sep 17 00:00:00 2001 From: Erlend Walstad <96946613+lampsitter@users.noreply.github.com> Date: Sun, 27 Nov 2022 13:15:18 +0100 Subject: [PATCH] Make it easier to convert strings to Id (#2350) --- crates/egui/src/id.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/egui/src/id.rs b/crates/egui/src/id.rs index 94184e0a..682818f9 100644 --- a/crates/egui/src/id.rs +++ b/crates/egui/src/id.rs @@ -85,6 +85,13 @@ impl From<&'static str> for Id { } } +impl From for Id { + #[inline] + fn from(string: String) -> Self { + Self::new(string) + } +} + // ---------------------------------------------------------------------------- // Idea taken from the `nohash_hasher` crate.