let mut arr: [MaybeUninit<u8>; 12] = unsafe { MaybeUninit::uninit().assume_init() };
or
let mut arr = [0u8; 12];
error: this call for this type may be undefined behavior
--> src/value.rs:129:42
|
129 | let mut arr: [u8; 12] = unsafe { MaybeUninit::uninit().assume_init() };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[deny(clippy::uninit_assumed_init)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninit_assumed_init
I think it's over-warning in this specific case. u8 is never read from and it doesn't implement Drop, it should be safe to assume init. But I'm also OK to change it to meet best practice.
https://github.com/tikv/agatedb/blob/4aa6420cf79c5ef1a73e346591cfe39cca3a1a15/src/value.rs#L129
should change to
or