From d074812179aabe790af7c5fae7d3617236a84a11 Mon Sep 17 00:00:00 2001 From: elvis Date: Tue, 17 Jun 2025 17:25:42 +0200 Subject: [PATCH] Into better than AsRef --- src/rsprocess/translator.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/rsprocess/translator.rs b/src/rsprocess/translator.rs index 4c1d264..20a520c 100644 --- a/src/rsprocess/translator.rs +++ b/src/rsprocess/translator.rs @@ -19,7 +19,11 @@ impl Translator { } impl Translator { - pub fn convert>(&mut self, s: S) -> IdType { - *(self.strings.entry(s.as_ref().to_string()).or_insert({self.last_id += 1; self.last_id})) + pub fn convert(&mut self, s: impl Into) -> IdType { + *(self.strings.entry(s.into()).or_insert( + {self.last_id += 1; + self.last_id + } + )) } }