You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
warning: calling `CStr::new` with a byte string literal
--> .../out/bindings.rs:708:14
|
708 | unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"Log\0") };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a `c""` literal: `c"Log"`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_c_str_literals
= note: `#[warn(clippy::manual_c_str_literals)]` on by default
Possible solutions
introduce a new generate_cstr_literal(bool) flag
change generate_cstr(bool) to take an enum instead, e.g. Off, CStrObjects, CStrLiterals
add #[allow(clippy::manual_c_str_literals)] to each instance of calling from_bytes_with_nul_unchecked
The text was updated successfully, but these errors were encountered:
nyurik
added a commit
to nyurik/rust-bindgen
that referenced
this issue
Nov 28, 2024
Clippy 1.83 introduced manual_c_str_literals on this type of generated code:
Possible solutions
generate_cstr_literal(bool)
flaggenerate_cstr(bool)
to take an enum instead, e.g.Off, CStrObjects, CStrLiterals
#[allow(clippy::manual_c_str_literals)]
to each instance of callingfrom_bytes_with_nul_unchecked
The text was updated successfully, but these errors were encountered: