From 81cf0430dea5e8b23a7a81e8c453cb6009b0b3f3 Mon Sep 17 00:00:00 2001 From: Piotr Jastrzebski Date: Sun, 7 Jul 2024 13:05:00 +0200 Subject: [PATCH] Improve normalize_ident Signed-off-by: Piotr Jastrzebski --- core/util.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/core/util.rs b/core/util.rs index d87b2df97..07a9f4b7e 100644 --- a/core/util.rs +++ b/core/util.rs @@ -1,6 +1,7 @@ -pub fn normalize_ident(mut ident: &str) -> String { - if ident.starts_with('"') && ident.ends_with('"') { - ident = &ident[1..ident.len() - 1]; - } - ident.to_lowercase() +pub fn normalize_ident(ident: &str) -> String { + (if ident.starts_with('"') && ident.ends_with('"') { + &ident[1..ident.len() - 1] + } else { + ident + }).to_lowercase() }