We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Mutability
1 parent da40965 commit e51cd6eCopy full SHA for e51cd6e
compiler/rustc_ast/src/ast.rs
@@ -789,15 +789,15 @@ impl Mutability {
789
}
790
791
/// Returns `""` (empty string) or `"mut "` depending on the mutability.
792
- pub fn prefix_str(&self) -> &'static str {
+ pub fn prefix_str(self) -> &'static str {
793
match self {
794
Mutability::Mut => "mut ",
795
Mutability::Not => "",
796
797
798
799
/// Returns `"&"` or `"&mut "` depending on the mutability.
800
- pub fn ref_prefix_str(&self) -> &'static str {
+ pub fn ref_prefix_str(self) -> &'static str {
801
802
Mutability::Not => "&",
803
Mutability::Mut => "&mut ",
0 commit comments