File tree 2 files changed +5
-9
lines changed
2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -63,15 +63,13 @@ explicit_into_iter_loop = "allow"
63
63
flat_map_option = " allow"
64
64
ignored_unit_patterns = " allow"
65
65
implicit_hasher = " allow"
66
- inconsistent_struct_constructor = " allow"
67
66
items_after_statements = " allow"
68
67
match_same_arms = " allow"
69
68
maybe_infinite_iter = " allow"
70
69
missing_errors_doc = " allow"
71
70
missing_panics_doc = " allow"
72
71
module_name_repetitions = " allow"
73
72
must_use_candidate = " allow"
74
- ptr_as_ptr = " allow"
75
73
redundant_closure_for_method_calls = " allow"
76
74
return_self_not_must_use = " allow"
77
75
similar_names = " allow"
Original file line number Diff line number Diff line change @@ -1045,9 +1045,7 @@ pub(crate) struct ClangToken {
1045
1045
impl ClangToken {
1046
1046
/// Get the token spelling, without being converted to utf-8.
1047
1047
pub ( crate ) fn spelling ( & self ) -> & [ u8 ] {
1048
- let c_str = unsafe {
1049
- CStr :: from_ptr ( clang_getCString ( self . spelling ) as * const _ )
1050
- } ;
1048
+ let c_str = unsafe { CStr :: from_ptr ( clang_getCString ( self . spelling ) ) } ;
1051
1049
c_str. to_bytes ( )
1052
1050
}
1053
1051
@@ -1098,9 +1096,9 @@ impl Iterator for ClangTokenIterator<'_> {
1098
1096
let spelling = clang_getTokenSpelling ( self . tu , * raw) ;
1099
1097
let extent = clang_getTokenExtent ( self . tu , * raw) ;
1100
1098
Some ( ClangToken {
1101
- kind,
1102
- extent,
1103
1099
spelling,
1100
+ extent,
1101
+ kind,
1104
1102
} )
1105
1103
}
1106
1104
}
@@ -1124,7 +1122,7 @@ extern "C" fn visit_children<Visitor>(
1124
1122
where
1125
1123
Visitor : FnMut ( Cursor ) -> CXChildVisitResult ,
1126
1124
{
1127
- let func: & mut Visitor = unsafe { & mut * ( data as * mut Visitor ) } ;
1125
+ let func: & mut Visitor = unsafe { & mut * data. cast :: < Visitor > ( ) } ;
1128
1126
let child = Cursor { x : cur } ;
1129
1127
1130
1128
( * func) ( child)
@@ -1763,7 +1761,7 @@ fn cxstring_to_string_leaky(s: CXString) -> String {
1763
1761
if s. data . is_null ( ) {
1764
1762
return String :: new ( ) ;
1765
1763
}
1766
- let c_str = unsafe { CStr :: from_ptr ( clang_getCString ( s) as * const _ ) } ;
1764
+ let c_str = unsafe { CStr :: from_ptr ( clang_getCString ( s) ) } ;
1767
1765
c_str. to_string_lossy ( ) . into_owned ( )
1768
1766
}
1769
1767
You can’t perform that action at this time.
0 commit comments