File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,9 +51,6 @@ future_incompatible = { level = "deny", priority = 1 }
5151unused = { level = " deny" , priority = 2 }
5252rust_2018_idioms = { level = " deny" , priority = 3 }
5353nonstandard_style = { level = " deny" , priority = 4 }
54- unexpected_cfgs = { level = " deny" , check-cfg = [
55- ' cfg(cryptsetup23supported)' , ' cfg(cryptsetup24supported)' , ' cfg(cryptsetup27supported)'
56- ] }
5754
5855[lints .clippy ]
5956all = { level = " deny" }
Original file line number Diff line number Diff line change @@ -18,13 +18,16 @@ fn main() {
1818 Ok ( l) => Version :: parse ( & l. version ) . unwrap ( ) ,
1919 Err ( e) => panic ! ( "Bindings require at least cryptsetup-2.2.0: {e}" ) ,
2020 } ;
21- for ver in SUPPORTED_VERSIONS . iter ( ) . take_while ( |ver_string| {
22- let iter_version = Version :: parse ( ver_string) . expect ( "Could not parse version" ) ;
23- version >= iter_version
24- } ) {
25- println ! (
26- "cargo:rustc-cfg=cryptsetup{}supported" ,
27- ver. split( '.' ) . take( 2 ) . collect:: <Vec <_>>( ) . join( "" )
21+ for ver_string in SUPPORTED_VERSIONS . iter ( ) {
22+ let version_cfg = format ! (
23+ "cryptsetup{}supported" ,
24+ ver_string. split( '.' ) . take( 2 ) . collect:: <Vec <_>>( ) . join( "" )
2825 ) ;
26+ println ! ( "cargo::rustc-check-cfg=cfg({version_cfg})" ) ;
27+
28+ let iter_version = Version :: parse ( ver_string) . expect ( "Could not parse version" ) ;
29+ if version >= iter_version {
30+ println ! ( "cargo:rustc-cfg={version_cfg}" ) ;
31+ }
2932 }
3033}
You can’t perform that action at this time.
0 commit comments