Allow clippy::unnecessary_fallible_conversions
FFI types like `c_long` vary on 32/64-bit, and the check is only needed on
64-bit conversions. Fixing this lint makes the code less readable.
```
error: use of a fallible conversion when an infallible one could be used
-->
packages/modules/Virtualization/authfs/fd_server/src/aidl.rs:380:36
|
380 | blockSize: st.block_size().try_into()?,
| ^^^^^^^^ help: use: `into`
|
= help: for further information visit
https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions
= note: `-D clippy::unnecessary-fallible-conversions` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_fallible_conversions)]`
```
Bug: http://b/321303117
Test: toolchain/android_rust/test_compiler.py --prebuilt-path dist/rust-dev.tar.xz --target aosp_cf_x86_64_phone --all-rust
Change-Id: I04c0ac34b8e084250803e8eeb17e0a109b10cbbc
diff --git a/authfs/fd_server/src/aidl.rs b/authfs/fd_server/src/aidl.rs
index ada3ffb..8edd899 100644
--- a/authfs/fd_server/src/aidl.rs
+++ b/authfs/fd_server/src/aidl.rs
@@ -375,6 +375,10 @@
}
}
+// FFI types like `c_long` vary on 32/64-bit, and the check is only needed on
+// 64-bit conversions. Fixing this lint makes the code less readable.
+#[allow(unknown_lints)]
+#[allow(clippy::unnecessary_fallible_conversions)]
fn try_into_fs_stat(st: Statvfs) -> Result<FsStat, std::num::TryFromIntError> {
Ok(FsStat {
blockSize: st.block_size().try_into()?,