File tree 1 file changed +10
-12
lines changed
1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -224,30 +224,28 @@ impl Cfg {
224
224
/// `Cfg`.
225
225
///
226
226
/// 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 > {
228
228
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 {
233
231
let mut sub_cfgs: Vec < Cfg > = if let Cfg :: All ( b) = assume {
234
232
a. iter ( ) . filter ( |a| !b. contains ( a) ) . cloned ( ) . collect ( )
235
233
} else {
236
234
a. iter ( ) . filter ( |& a| a != assume) . cloned ( ) . collect ( )
237
235
} ;
238
236
let len = sub_cfgs. len ( ) ;
239
- return match len {
237
+ match len {
240
238
0 => None ,
241
239
1 => sub_cfgs. pop ( ) ,
242
240
_ => Some ( Cfg :: All ( sub_cfgs) ) ,
243
- } ;
244
- } else if let Cfg :: All ( b) = assume {
245
- if b. contains ( self ) {
246
- return None ;
247
241
}
242
+ } else if let Cfg :: All ( b) = assume
243
+ && b. contains ( self )
244
+ {
245
+ None
246
+ } else {
247
+ Some ( self . clone ( ) )
248
248
}
249
-
250
- Some ( self . clone ( ) )
251
249
}
252
250
}
253
251
You can’t perform that action at this time.
0 commit comments