Skip to content

Commit e51cd6e

Browse files
committed
Don't accept Mutability by ref
1 parent da40965 commit e51cd6e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_ast/src/ast.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -789,15 +789,15 @@ impl Mutability {
789789
}
790790

791791
/// Returns `""` (empty string) or `"mut "` depending on the mutability.
792-
pub fn prefix_str(&self) -> &'static str {
792+
pub fn prefix_str(self) -> &'static str {
793793
match self {
794794
Mutability::Mut => "mut ",
795795
Mutability::Not => "",
796796
}
797797
}
798798

799799
/// Returns `"&"` or `"&mut "` depending on the mutability.
800-
pub fn ref_prefix_str(&self) -> &'static str {
800+
pub fn ref_prefix_str(self) -> &'static str {
801801
match self {
802802
Mutability::Not => "&",
803803
Mutability::Mut => "&mut ",

0 commit comments

Comments
 (0)