clippy fix: casting to the same type is unnecessary

See: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
This commit is contained in:
Lukas Wagner 2023-08-08 11:44:54 +02:00 committed by Wolfgang Bumiller
parent 41b2e49123
commit 5ea70421b3

View File

@ -137,6 +137,10 @@ pub fn strftime(format: &str, t: &libc::tm) -> Result<String, Error> {
// -1,, it's unsigned
bail!("strftime failed");
}
// `res` is a `libc::size_t`, which on a different target architecture might not be directly
// assignable to a `usize`. Thus, we actually want a cast here.
#[allow(clippy::unnecessary_cast)]
let len = res as usize;
if len == 0 {