File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Expand file tree Collapse file tree 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"
6363flat_map_option = " allow"
6464ignored_unit_patterns = " allow"
6565implicit_hasher = " allow"
66- inconsistent_struct_constructor = " allow"
6766items_after_statements = " allow"
6867match_same_arms = " allow"
6968maybe_infinite_iter = " allow"
7069missing_errors_doc = " allow"
7170missing_panics_doc = " allow"
7271module_name_repetitions = " allow"
7372must_use_candidate = " allow"
74- ptr_as_ptr = " allow"
7573redundant_closure_for_method_calls = " allow"
7674return_self_not_must_use = " allow"
7775similar_names = " allow"
Original file line number Diff line number Diff line change @@ -1045,9 +1045,7 @@ pub(crate) struct ClangToken {
10451045impl ClangToken {
10461046 /// Get the token spelling, without being converted to utf-8.
10471047 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 ) ) } ;
10511049 c_str. to_bytes ( )
10521050 }
10531051
@@ -1098,9 +1096,9 @@ impl Iterator for ClangTokenIterator<'_> {
10981096 let spelling = clang_getTokenSpelling ( self . tu , * raw) ;
10991097 let extent = clang_getTokenExtent ( self . tu , * raw) ;
11001098 Some ( ClangToken {
1101- kind,
1102- extent,
11031099 spelling,
1100+ extent,
1101+ kind,
11041102 } )
11051103 }
11061104 }
@@ -1124,7 +1122,7 @@ extern "C" fn visit_children<Visitor>(
11241122where
11251123 Visitor : FnMut ( Cursor ) -> CXChildVisitResult ,
11261124{
1127- let func: & mut Visitor = unsafe { & mut * ( data as * mut Visitor ) } ;
1125+ let func: & mut Visitor = unsafe { & mut * data. cast :: < Visitor > ( ) } ;
11281126 let child = Cursor { x : cur } ;
11291127
11301128 ( * func) ( child)
@@ -1763,7 +1761,7 @@ fn cxstring_to_string_leaky(s: CXString) -> String {
17631761 if s. data . is_null ( ) {
17641762 return String :: new ( ) ;
17651763 }
1766- let c_str = unsafe { CStr :: from_ptr ( clang_getCString ( s) as * const _ ) } ;
1764+ let c_str = unsafe { CStr :: from_ptr ( clang_getCString ( s) ) } ;
17671765 c_str. to_string_lossy ( ) . into_owned ( )
17681766}
17691767
You can’t perform that action at this time.
0 commit comments