From d8649c1af86118dea6b6340c999b5864a8d55279 Mon Sep 17 00:00:00 2001 From: kjeremy Date: Fri, 26 Apr 2019 11:42:56 -0400 Subject: Simplify --- crates/ra_prof/src/lib.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'crates/ra_prof/src/lib.rs') diff --git a/crates/ra_prof/src/lib.rs b/crates/ra_prof/src/lib.rs index ba432912f..9ecb8e744 100644 --- a/crates/ra_prof/src/lib.rs +++ b/crates/ra_prof/src/lib.rs @@ -67,14 +67,11 @@ pub fn profile(desc: &str) -> Profiler { PROFILE_STACK.with(|stack| { let mut stack = stack.borrow_mut(); - if stack.starts.len() == 0 { - match FILTER.try_read() { - Ok(f) => { - if f.version > stack.filter_data.version { - stack.filter_data = f.clone(); - } + if stack.starts.is_empty() { + if let Ok(f) = FILTER.try_read() { + if f.version > stack.filter_data.version { + stack.filter_data = f.clone(); } - Err(_) => (), }; } -- cgit v1.2.3