mirror of https://github.com/astral-sh/ruff
perf: Use specialized `ToString`
Ref: https://rust-lang.github.io/rust-clippy/master/index.html#inefficient_to_string
This commit is contained in:
parent
f8af40173a
commit
668e41f0f6
|
|
@ -311,7 +311,7 @@ pub fn check_repeated_keys(
|
|||
(Some(DictionaryKey::Variable(v1)), Some(DictionaryKey::Variable(v2))) => {
|
||||
if check_repeated_variables && v1 == v2 {
|
||||
checks.push(Check::new(
|
||||
CheckKind::MultiValueRepeatedKeyVariable(v2.to_string()),
|
||||
CheckKind::MultiValueRepeatedKeyVariable((*v2).to_string()),
|
||||
k2.location,
|
||||
))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -997,7 +997,7 @@ impl<'a> Checker<'a> {
|
|||
|
||||
for builtin in BUILTINS {
|
||||
scope.values.insert(
|
||||
builtin.to_string(),
|
||||
(*builtin).to_string(),
|
||||
Binding {
|
||||
kind: BindingKind::Builtin,
|
||||
location: Default::default(),
|
||||
|
|
@ -1007,7 +1007,7 @@ impl<'a> Checker<'a> {
|
|||
}
|
||||
for builtin in MAGIC_GLOBALS {
|
||||
scope.values.insert(
|
||||
builtin.to_string(),
|
||||
(*builtin).to_string(),
|
||||
Binding {
|
||||
kind: BindingKind::Builtin,
|
||||
location: Default::default(),
|
||||
|
|
|
|||
Loading…
Reference in New Issue