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 @@ -226,30 +226,28 @@ impl Cfg {
226
226
/// `Cfg`.
227
227
///
228
228
/// See `tests::test_simplify_with` for examples.
229
- pub ( crate ) fn simplify_with ( & self , assume : & Cfg ) -> Option < Cfg > {
229
+ pub ( crate ) fn simplify_with ( & self , assume : & Self ) -> Option < Self > {
230
230
if self == assume {
231
- return None ;
232
- }
233
-
234
- if let Cfg :: All ( a) = self {
231
+ None
232
+ } else if let Cfg :: All ( a) = self {
235
233
let mut sub_cfgs: Vec < Cfg > = if let Cfg :: All ( b) = assume {
236
234
a. iter ( ) . filter ( |a| !b. contains ( a) ) . cloned ( ) . collect ( )
237
235
} else {
238
236
a. iter ( ) . filter ( |& a| a != assume) . cloned ( ) . collect ( )
239
237
} ;
240
238
let len = sub_cfgs. len ( ) ;
241
- return match len {
239
+ match len {
242
240
0 => None ,
243
241
1 => sub_cfgs. pop ( ) ,
244
242
_ => Some ( Cfg :: All ( sub_cfgs) ) ,
245
- } ;
246
- } else if let Cfg :: All ( b) = assume {
247
- if b. contains ( self ) {
248
- return None ;
249
243
}
244
+ } else if let Cfg :: All ( b) = assume
245
+ && b. contains ( self )
246
+ {
247
+ None
248
+ } else {
249
+ Some ( self . clone ( ) )
250
250
}
251
-
252
- Some ( self . clone ( ) )
253
251
}
254
252
}
255
253
You can’t perform that action at this time.
0 commit comments