File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -224,30 +224,28 @@ impl Cfg {
224224 /// `Cfg`.
225225 ///
226226 /// See `tests::test_simplify_with` for examples.
227- pub ( crate ) fn simplify_with ( & self , assume : & Cfg ) -> Option < Cfg > {
227+ pub ( crate ) fn simplify_with ( & self , assume : & Self ) -> Option < Self > {
228228 if self == assume {
229- return None ;
230- }
231-
232- if let Cfg :: All ( a) = self {
229+ None
230+ } else if let Cfg :: All ( a) = self {
233231 let mut sub_cfgs: Vec < Cfg > = if let Cfg :: All ( b) = assume {
234232 a. iter ( ) . filter ( |a| !b. contains ( a) ) . cloned ( ) . collect ( )
235233 } else {
236234 a. iter ( ) . filter ( |& a| a != assume) . cloned ( ) . collect ( )
237235 } ;
238236 let len = sub_cfgs. len ( ) ;
239- return match len {
237+ match len {
240238 0 => None ,
241239 1 => sub_cfgs. pop ( ) ,
242240 _ => Some ( Cfg :: All ( sub_cfgs) ) ,
243- } ;
244- } else if let Cfg :: All ( b) = assume {
245- if b. contains ( self ) {
246- return None ;
247241 }
242+ } else if let Cfg :: All ( b) = assume
243+ && b. contains ( self )
244+ {
245+ None
246+ } else {
247+ Some ( self . clone ( ) )
248248 }
249-
250- Some ( self . clone ( ) )
251249 }
252250}
253251
You can’t perform that action at this time.
0 commit comments