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
|
@ -1824,12 +1824,10 @@ impl BorrowKind {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn describe_mutability(&self) -> String {
|
||||
pub fn describe_mutability(&self) -> &str {
|
||||
match *self {
|
||||
BorrowKind::Shared | BorrowKind::Shallow | BorrowKind::Unique => {
|
||||
"immutable".to_string()
|
||||
}
|
||||
BorrowKind::Mut { .. } => "mutable".to_string(),
|
||||
BorrowKind::Shared | BorrowKind::Shallow | BorrowKind::Unique => "immutable",
|
||||
BorrowKind::Mut { .. } => "mutable",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue