diff options
| author | Maybe Waffle <waffle.lapkin@gmail.com> | 2022-11-23 19:07:02 +0000 |
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2022-11-23 20:26:31 +0000 |
| commit | e51cd6e8224c71f7c178a463dd096c3fee37a011 (patch) | |
| tree | e54996f00206f90150d3a80e22745f24d1819d41 | |
| parent | da40965300eec9aad4ea2f2fde9e6b59262cd5d6 (diff) | |
| download | rust-e51cd6e8224c71f7c178a463dd096c3fee37a011.tar.gz rust-e51cd6e8224c71f7c178a463dd096c3fee37a011.zip | |
Don't accept `Mutability` by ref
| -rw-r--r-- | compiler/rustc_ast/src/ast.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index 146fe7cd593..dc57f278df8 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -789,7 +789,7 @@ impl Mutability { } /// Returns `""` (empty string) or `"mut "` depending on the mutability. - pub fn prefix_str(&self) -> &'static str { + pub fn prefix_str(self) -> &'static str { match self { Mutability::Mut => "mut ", Mutability::Not => "", @@ -797,7 +797,7 @@ impl Mutability { } /// Returns `"&"` or `"&mut "` depending on the mutability. - pub fn ref_prefix_str(&self) -> &'static str { + pub fn ref_prefix_str(self) -> &'static str { match self { Mutability::Not => "&", Mutability::Mut => "&mut ", |
