File tree 1 file changed +2
-9
lines changed
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 {
155
155
// account for compile differences and such.
156
156
println ! ( "cargo:rerun-if-changed=build/expando.c" ) ;
157
157
let mut gcc = cc:: Build :: new ( ) ;
158
- for include_dir in include_dirs {
159
- gcc. include ( include_dir) ;
160
- }
158
+ gcc. includes ( include_dirs) ;
161
159
let expanded = match gcc. file ( "build/expando.c" ) . try_expand ( ) {
162
160
Ok ( expanded) => expanded,
163
161
Err ( e) => {
@@ -326,18 +324,13 @@ due to this version mismatch.
326
324
}
327
325
328
326
// 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
331
327
fn parse_version ( version : & str ) -> u64 {
332
328
// cut off the 0x prefix
333
329
assert ! ( version. starts_with( "0x" ) ) ;
334
330
let version = & version[ 2 ..] ;
335
331
336
332
// 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 ( ) ) ;
341
334
342
335
u64:: from_str_radix ( version, 16 ) . unwrap ( )
343
336
}
You can’t perform that action at this time.
0 commit comments