File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed
Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -544,21 +544,21 @@ pub(crate) fn varsubstitute(s: &str, subs: &Vec<crate::ffi::StringMapping>) -> C
544544 Ok ( varsubst ( s, & m) ?)
545545}
546546
547- #[ allow( clippy:: vec_init_then_push) ]
548547pub ( crate ) fn get_features ( ) -> Vec < String > {
549548 // These constant features were originally set in configure.ac, but have migrated to
550549 // Rust in the interest in having less logic in autoconf.
551- let mut r = vec ! [ "rust" . to_string( ) , "compose" . to_string( ) ] ;
552- if cfg ! ( feature = "fedora-integration" ) {
553- r. push ( "fedora-integration" . to_string ( ) ) ;
554- }
555- if cfg ! ( feature = "bin-unit-tests" ) {
556- r. push ( "bin-unit-tests" . to_string ( ) ) ;
557- }
558- if cfg ! ( feature = "rhsm" ) {
559- r. push ( "rhsm" . to_string ( ) ) ;
560- }
561- r
550+ let defaults = [ "rust" , "compose" ] . into_iter ( ) . map ( Some ) ;
551+ let conditionals = [
552+ cfg ! ( feature = "fedora-integration" ) . then ( || "fedora-integration" ) ,
553+ cfg ! ( feature = "bin-unit-tests" ) . then ( || "bin-unit-tests" ) ,
554+ cfg ! ( feature = "rhsm" ) . then ( || "rhsm" ) ,
555+ ]
556+ . into_iter ( ) ;
557+ defaults
558+ . chain ( conditionals)
559+ . flatten ( )
560+ . map ( String :: from)
561+ . collect ( )
562562}
563563
564564fn impl_sealed_memfd ( description : & str , content : & [ u8 ] ) -> Result < std:: fs:: File > {
You can’t perform that action at this time.
0 commit comments