[PATCH v4 5/6] rust: remove `#[allow(clippy::unnecessary_cast)]`