misc: Use c"" to construct nul-terminated string

As clippy of rust-toolchain version 1.83.0-beta.1 suggests, use `c""` to
construct nul-terminated `CStr`.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
This commit is contained in:
Ruoqing He 2024-10-18 17:36:51 +08:00 committed by Rob Bradford
parent b41daddce1
commit 86315adb23

View File

@ -124,7 +124,7 @@ impl Tap {
// Open calls are safe because we give a constant null-terminated
// string and verify the result.
libc::open(
b"/dev/net/tun\0".as_ptr() as *const c_char,
c"/dev/net/tun".as_ptr() as *const c_char,
flags.unwrap_or(libc::O_RDWR | libc::O_NONBLOCK | libc::O_CLOEXEC),
)
};