From 4f6f3933ec04df55a39368d591c91cf81d980237 Mon Sep 17 00:00:00 2001 From: Phil Ellison Date: Sun, 11 Aug 2019 15:04:08 +0100 Subject: cargo format --- crates/ra_hir/src/expr/validation.rs | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'crates/ra_hir/src/expr') diff --git a/crates/ra_hir/src/expr/validation.rs b/crates/ra_hir/src/expr/validation.rs index 339a7b848..f0da3d169 100644 --- a/crates/ra_hir/src/expr/validation.rs +++ b/crates/ra_hir/src/expr/validation.rs @@ -12,7 +12,7 @@ use crate::{ name, path::{PathKind, PathSegment}, ty::{InferenceResult, Ty, TypeCtor}, - Function, HasSource, HirDatabase, ModuleDef, Name, Path, PerNs, Resolution + Function, HasSource, HirDatabase, ModuleDef, Name, Path, PerNs, Resolution, }; use ra_syntax::ast; @@ -116,26 +116,25 @@ impl<'a, 'b> ExprValidator<'a, 'b> { PathSegment { name: name::STD, args_and_bindings: None }, PathSegment { name: name::RESULT_MOD, args_and_bindings: None }, PathSegment { name: name::RESULT_TYPE, args_and_bindings: None }, - ] + ], }; let resolver = self.func.resolver(db); - let std_result_enum = match resolver.resolve_path_segments(db, &std_result_path).into_fully_resolved() { - PerNs { types: Some(Resolution::Def(ModuleDef::Enum(e))), .. } => e, - _ => return, - }; + let std_result_enum = + match resolver.resolve_path_segments(db, &std_result_path).into_fully_resolved() { + PerNs { types: Some(Resolution::Def(ModuleDef::Enum(e))), .. } => e, + _ => return, + }; let std_result_type = std_result_enum.ty(db); fn enum_from_type(ty: &Ty) -> Option { match ty { - Ty::Apply(t) => { - match t.ctor { - TypeCtor::Adt(AdtDef::Enum(e)) => Some(e), - _ => None, - } - } - _ => None + Ty::Apply(t) => match t.ctor { + TypeCtor::Adt(AdtDef::Enum(e)) => Some(e), + _ => None, + }, + _ => None, } } -- cgit v1.2.3