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))) => {
|
(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,
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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(),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue