File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -155,9 +155,7 @@ fn validate_headers(include_dirs: &[PathBuf]) -> Version {
155155 // account for compile differences and such.
156156 println ! ( "cargo:rerun-if-changed=build/expando.c" ) ;
157157 let mut gcc = cc:: Build :: new ( ) ;
158- for include_dir in include_dirs {
159- gcc. include ( include_dir) ;
160- }
158+ gcc. includes ( include_dirs) ;
161159 let expanded = match gcc. file ( "build/expando.c" ) . try_expand ( ) {
162160 Ok ( expanded) => expanded,
163161 Err ( e) => {
@@ -326,18 +324,13 @@ due to this version mismatch.
326324}
327325
328326// parses a string that looks like "0x100020cfL"
329- #[ allow( deprecated) ] // trim_right_matches is now trim_end_matches
330- #[ allow( clippy:: match_like_matches_macro) ] // matches macro requires rust 1.42.0
331327fn parse_version ( version : & str ) -> u64 {
332328 // cut off the 0x prefix
333329 assert ! ( version. starts_with( "0x" ) ) ;
334330 let version = & version[ 2 ..] ;
335331
336332 // and the type specifier suffix
337- let version = version. trim_right_matches ( |c : char | match c {
338- '0' ..='9' | 'a' ..='f' | 'A' ..='F' => false ,
339- _ => true ,
340- } ) ;
333+ let version = version. trim_end_matches ( |c : char | !c. is_ascii_hexdigit ( ) ) ;
341334
342335 u64:: from_str_radix ( version, 16 ) . unwrap ( )
343336}
You can’t perform that action at this time.
0 commit comments