[PATCH v3 2/3] rust: remove `#[allow(clippy::unnecessary_cast)]`