From c476742f47dd905fa366e62f480e3f656c62e66c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 10 Apr 2020 17:47:49 +0200 Subject: Simplify --- crates/ra_syntax/src/ast/extensions.rs | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'crates/ra_syntax/src/ast/extensions.rs') diff --git a/crates/ra_syntax/src/ast/extensions.rs b/crates/ra_syntax/src/ast/extensions.rs index 1aacb0676..76b7655e6 100644 --- a/crates/ra_syntax/src/ast/extensions.rs +++ b/crates/ra_syntax/src/ast/extensions.rs @@ -275,7 +275,7 @@ pub enum SelfParamKind { impl ast::SelfParam { pub fn kind(&self) -> SelfParamKind { if self.amp_token().is_some() { - if self.amp_mut_token().is_some() { + if self.mut_token().is_some() { SelfParamKind::MutRef } else { SelfParamKind::Ref @@ -284,24 +284,6 @@ impl ast::SelfParam { SelfParamKind::Owned } } - - /// the "mut" in "mut self", not the one in "&mut self" - pub fn mut_token(&self) -> Option { - self.syntax() - .children_with_tokens() - .filter_map(|it| it.into_token()) - .take_while(|it| it.kind() != T![&]) - .find(|it| it.kind() == T![mut]) - } - - /// the "mut" in "&mut self", not the one in "mut self" - pub fn amp_mut_token(&self) -> Option { - self.syntax() - .children_with_tokens() - .filter_map(|it| it.into_token()) - .skip_while(|it| it.kind() != T![&]) - .find(|it| it.kind() == T![mut]) - } } #[derive(Clone, Debug, PartialEq, Eq, Hash)] -- cgit v1.2.3