avoid some &str
to String
conversions
This commit is contained in:
parent
fac8fa5672
commit
bda83e6543
13 changed files with 23 additions and 34 deletions
|
@ -1929,12 +1929,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