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