1 error: using `libc::strlen` on a `CString` or `CStr` value
2 --> $DIR/strlen_on_c_strings.rs:12:24
4 LL | let len = unsafe { libc::strlen(cstring.as_ptr()) };
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7 = note: `-D clippy::strlen-on-c-strings` implied by `-D warnings`
8 help: try this (you might also need to get rid of `unsafe` block in some cases):
10 LL | let len = unsafe { cstring.as_bytes().len() };
11 | ~~~~~~~~~~~~~~~~~~~~~~~~
13 error: using `libc::strlen` on a `CString` or `CStr` value
14 --> $DIR/strlen_on_c_strings.rs:16:24
16 LL | let len = unsafe { libc::strlen(cstr.as_ptr()) };
17 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
19 help: try this (you might also need to get rid of `unsafe` block in some cases):
21 LL | let len = unsafe { cstr.to_bytes().len() };
22 | ~~~~~~~~~~~~~~~~~~~~~
24 error: using `libc::strlen` on a `CString` or `CStr` value
25 --> $DIR/strlen_on_c_strings.rs:18:24
27 LL | let len = unsafe { strlen(cstr.as_ptr()) };
28 | ^^^^^^^^^^^^^^^^^^^^^
30 help: try this (you might also need to get rid of `unsafe` block in some cases):
32 LL | let len = unsafe { cstr.to_bytes().len() };
33 | ~~~~~~~~~~~~~~~~~~~~~
35 error: aborting due to 3 previous errors