From 92b2230fefe61322dbca8194c8721f848c5d1c2f Mon Sep 17 00:00:00 2001 From: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com> Date: Sun, 10 May 2020 12:45:35 +0200 Subject: add if let and while let postfix for Option and Result Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com> --- crates/ra_hir/src/code_model.rs | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'crates/ra_hir/src') diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 6d8444462..be18c845c 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs @@ -1086,28 +1086,6 @@ impl Type { matches!(self.ty.value, Ty::Apply(ApplicationTy { ctor: TypeCtor::Bool, .. })) } - pub fn is_option(&self, db: &dyn HirDatabase) -> bool { - if let Some(adt_ty) = self.as_adt() { - if let Adt::Enum(_) = adt_ty { - if self.display(db).to_string().starts_with("Option<") { - return true; - } - } - } - false - } - - pub fn is_result(&self, db: &dyn HirDatabase) -> bool { - if let Some(adt_ty) = self.as_adt() { - if let Adt::Enum(_) = adt_ty { - if self.display(db).to_string().starts_with("Result<") { - return true; - } - } - } - false - } - pub fn is_mutable_reference(&self) -> bool { matches!( self.ty.value, -- cgit v1.2.3