Rollup merge of #99103 - TaKO8Ki:avoid-&str-to-string-conversions, r=oli-obk
Avoid some `&str` to `String` conversions This patch removes some `&str` to `String` conversions.
This commit is contained in:
commit
86af7135ae
13 changed files with 23 additions and 34 deletions
|
@ -597,16 +597,16 @@ impl UseSpans<'_> {
|
|||
}
|
||||
|
||||
/// Describe the span associated with a use of a place.
|
||||
pub(super) fn describe(&self) -> String {
|
||||
pub(super) fn describe(&self) -> &str {
|
||||
match *self {
|
||||
UseSpans::ClosureUse { generator_kind, .. } => {
|
||||
if generator_kind.is_some() {
|
||||
" in generator".to_string()
|
||||
" in generator"
|
||||
} else {
|
||||
" in closure".to_string()
|
||||
" in closure"
|
||||
}
|
||||
}
|
||||
_ => String::new(),
|
||||
_ => "",
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue