introduce Mutability::ptr_str
This commit is contained in:
parent
db3a5c5873
commit
277e61854e
4 changed files with 12 additions and 24 deletions
|
@ -51,6 +51,14 @@ impl Mutability {
|
|||
}
|
||||
}
|
||||
|
||||
/// Returns `"const"` or `"mut"` depending on the mutability.
|
||||
pub fn ptr_str(self) -> &'static str {
|
||||
match self {
|
||||
Mutability::Not => "const",
|
||||
Mutability::Mut => "mut",
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns `""` (empty string) or `"mutably "` depending on the mutability.
|
||||
pub fn mutably_str(self) -> &'static str {
|
||||
match self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue