perf: Use specialized `ToString`

Ref: https://rust-lang.github.io/rust-clippy/master/index.html#inefficient_to_string
This commit is contained in:
Dmitry Dygalo 2022-09-13 11:32:36 +02:00
parent f8af40173a
commit 668e41f0f6
No known key found for this signature in database
GPG Key ID: 0D78E60518FE18BB
2 changed files with 3 additions and 3 deletions

View File

@ -311,7 +311,7 @@ pub fn check_repeated_keys(
(Some(DictionaryKey::Variable(v1)), Some(DictionaryKey::Variable(v2))) => { (Some(DictionaryKey::Variable(v1)), Some(DictionaryKey::Variable(v2))) => {
if check_repeated_variables && v1 == v2 { if check_repeated_variables && v1 == v2 {
checks.push(Check::new( checks.push(Check::new(
CheckKind::MultiValueRepeatedKeyVariable(v2.to_string()), CheckKind::MultiValueRepeatedKeyVariable((*v2).to_string()),
k2.location, k2.location,
)) ))
} }

View File

@ -997,7 +997,7 @@ impl<'a> Checker<'a> {
for builtin in BUILTINS { for builtin in BUILTINS {
scope.values.insert( scope.values.insert(
builtin.to_string(), (*builtin).to_string(),
Binding { Binding {
kind: BindingKind::Builtin, kind: BindingKind::Builtin,
location: Default::default(), location: Default::default(),
@ -1007,7 +1007,7 @@ impl<'a> Checker<'a> {
} }
for builtin in MAGIC_GLOBALS { for builtin in MAGIC_GLOBALS {
scope.values.insert( scope.values.insert(
builtin.to_string(), (*builtin).to_string(),
Binding { Binding {
kind: BindingKind::Builtin, kind: BindingKind::Builtin,
location: Default::default(), location: Default::default(),