File tree Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -1839,10 +1839,7 @@ impl Index {
1839
1839
pub ( crate ) fn new ( pch : bool , diag : bool ) -> Index {
1840
1840
unsafe {
1841
1841
Index {
1842
- x : clang_createIndex (
1843
- pch. try_into ( ) . unwrap ( ) ,
1844
- diag. try_into ( ) . unwrap ( ) ,
1845
- ) ,
1842
+ x : clang_createIndex ( pch. into ( ) , diag. into ( ) ) ,
1846
1843
}
1847
1844
}
1848
1845
}
@@ -1917,7 +1914,7 @@ impl TranslationUnit {
1917
1914
let mut diags = vec ! [ ] ;
1918
1915
for i in 0 ..num {
1919
1916
diags. push ( Diagnostic {
1920
- x : clang_getDiagnostic ( self . x , i. try_into ( ) . unwrap ( ) ) ,
1917
+ x : clang_getDiagnostic ( self . x , i) ,
1921
1918
} ) ;
1922
1919
}
1923
1920
diags
@@ -2324,10 +2321,12 @@ impl EvalResult {
2324
2321
2325
2322
if unsafe { clang_EvalResult_isUnsignedInt ( self . x ) } != 0 {
2326
2323
let value = unsafe { clang_EvalResult_getAsUnsigned ( self . x ) } ;
2324
+ #[ allow( clippy:: unnecessary_fallible_conversions) ]
2327
2325
return i128:: try_from ( value) . ok ( ) ;
2328
2326
}
2329
2327
2330
2328
let value = unsafe { clang_EvalResult_getAsLongLong ( self . x ) } ;
2329
+ #[ allow( clippy:: unnecessary_fallible_conversions) ]
2331
2330
i128:: try_from ( value) . ok ( )
2332
2331
}
2333
2332
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ impl CodeGenerator for MacroDef {
117
117
}
118
118
result. saw_var_macro ( name) ;
119
119
120
- let canonical_ident = ctx. rust_ident ( & canonical_name) ;
120
+ let canonical_ident = ctx. rust_ident ( canonical_name) ;
121
121
122
122
let mut var_macro = match ctx. macro_set . expand_var_macro ( name) {
123
123
Ok ( body) => match VarMacro :: parse ( name, & body) {
Original file line number Diff line number Diff line change @@ -592,7 +592,7 @@ where
592
592
const is_ms_struct: bool = false ;
593
593
594
594
for bitfield in raw_bitfields {
595
- let bitfield_width = bitfield. bitfield_width ( ) . unwrap ( ) as usize ;
595
+ let bitfield_width = bitfield. bitfield_width ( ) . unwrap ( ) ;
596
596
let bitfield_layout =
597
597
ctx. resolve_type ( bitfield. ty ( ) ) . layout ( ctx) . ok_or ( ( ) ) ?;
598
598
let bitfield_size = bitfield_layout. size ;
You can’t perform that action at this time.
0 commit comments