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 @@ -226,30 +226,28 @@ impl Cfg {
226226 /// `Cfg`.
227227 ///
228228 /// 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 > {
230230 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 {
235233 let mut sub_cfgs: Vec < Cfg > = if let Cfg :: All ( b) = assume {
236234 a. iter ( ) . filter ( |a| !b. contains ( a) ) . cloned ( ) . collect ( )
237235 } else {
238236 a. iter ( ) . filter ( |& a| a != assume) . cloned ( ) . collect ( )
239237 } ;
240238 let len = sub_cfgs. len ( ) ;
241- return match len {
239+ match len {
242240 0 => None ,
243241 1 => sub_cfgs. pop ( ) ,
244242 _ => Some ( Cfg :: All ( sub_cfgs) ) ,
245- } ;
246- } else if let Cfg :: All ( b) = assume {
247- if b. contains ( self ) {
248- return None ;
249243 }
244+ } else if let Cfg :: All ( b) = assume
245+ && b. contains ( self )
246+ {
247+ None
248+ } else {
249+ Some ( self . clone ( ) )
250250 }
251-
252- Some ( self . clone ( ) )
253251 }
254252}
255253
You can’t perform that action at this time.
0 commit comments