diff --git a/src/librustc/middle/resolve_lifetime.rs b/src/librustc/middle/resolve_lifetime.rs index 736b4633b38f9..593a09b6866db 100644 --- a/src/librustc/middle/resolve_lifetime.rs +++ b/src/librustc/middle/resolve_lifetime.rs @@ -170,16 +170,11 @@ pub enum Set1 { impl Set1 { pub fn insert(&mut self, value: T) { - if let Set1::Empty = *self { - *self = Set1::One(value); - return; - } - if let Set1::One(ref old) = *self { - if *old == value { - return; - } - } - *self = Set1::Many; + *self = match self { + Set1::Empty => Set1::One(value), + Set1::One(old) if *old == value => return, + _ => Set1::Many, + }; } }