File tree 5 files changed +9
-6
lines changed
generators/rust-oo-bindgen/src 5 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -156,6 +156,7 @@ impl<'a> RustCodegen<'a> {
156
156
} ;
157
157
158
158
// Accessor
159
+ f. writeln ( "#[allow(clippy::needless_lifetimes)]" ) ?;
159
160
f. writeln ( & format ! (
160
161
"pub fn {name}{fn_lifetime}(&{lifetime}self) -> {ampersand}{return_type}" ,
161
162
name = element. name,
@@ -191,7 +192,10 @@ impl<'a> RustCodegen<'a> {
191
192
}
192
193
} ) ?;
193
194
195
+ f. newline ( ) ?;
196
+
194
197
// Mutator
198
+ f. writeln ( "#[allow(clippy::needless_lifetimes)]" ) ?;
195
199
f. writeln ( & format ! (
196
200
"pub fn set_{name}{fn_lifetime}(&{lifetime}mut self, value: {element_type})" ,
197
201
name = element. name,
@@ -334,6 +338,7 @@ impl<'a> RustCodegen<'a> {
334
338
f : & mut dyn Printer ,
335
339
handle : & NativeFunctionHandle ,
336
340
) -> FormattingResult < ( ) > {
341
+ f. writeln ( "#[allow(clippy::missing_safety_doc)]" ) ?;
337
342
f. writeln ( "#[no_mangle]" ) ?;
338
343
f. writeln ( & format ! ( "pub unsafe extern \" C\" fn {}(" , handle. name) ) ?;
339
344
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ pub unsafe fn collection_destroy(col: *mut StringCollection) {
36
36
}
37
37
}
38
38
39
- pub unsafe fn collection_add < ' a > ( col : * mut StringCollection , value : & ' a CStr ) {
39
+ pub unsafe fn collection_add ( col : * mut StringCollection , value : & CStr ) {
40
40
if let Some ( col) = col. as_mut ( ) {
41
41
let value = value. to_owned ( ) ;
42
42
col. add ( value) ;
Original file line number Diff line number Diff line change 1
- #![ allow( clippy:: missing_safety_doc) ]
2
-
3
1
include ! ( concat!( env!( "OUT_DIR" ) , "/ffi.rs" ) ) ;
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ impl StringIterator {
22
22
}
23
23
}
24
24
25
- pub unsafe fn iterator_create < ' a > ( value : & ' a CStr ) -> * mut StringIterator {
25
+ pub unsafe fn iterator_create ( value : & CStr ) -> * mut StringIterator {
26
26
let bytes = value. to_bytes ( ) . to_vec ( ) ;
27
27
let it = Box :: new ( StringIterator :: new ( bytes) ) ;
28
28
Box :: into_raw ( it)
Original file line number Diff line number Diff line change @@ -23,12 +23,12 @@ pub unsafe fn string_destroy(string_class: *mut StringClass) {
23
23
}
24
24
}
25
25
26
- pub unsafe fn string_echo < ' a > ( string_class : * mut StringClass , value : & ' a CStr ) -> & ' a CStr {
26
+ pub unsafe fn string_echo ( string_class : * mut StringClass , value : & CStr ) -> & CStr {
27
27
let mut string_class = string_class. as_mut ( ) . unwrap ( ) ;
28
28
string_class. value = value. to_owned ( ) ;
29
29
& string_class. value
30
30
}
31
31
32
- pub unsafe fn string_length < ' a > ( value : & ' a CStr ) -> u32 {
32
+ pub unsafe fn string_length ( value : & CStr ) -> u32 {
33
33
value. to_string_lossy ( ) . len ( ) as u32
34
34
}
You can’t perform that action at this time.
0 commit comments