Fix deprecated use of min_value/max_value.
error: usage of a legacy numeric method
--> external/rust/crates/libsqlite3-sys/android/build.rs:10:26
|
10 | if value >= i32::min_value() as i64 && value <= i32::max_value() as i64 {
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
= note: `-D clippy::legacy-numeric-constants` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::legacy_numeric_constants)]`
help: use the associated constant instead
|
10 | if value >= i32::MIN as i64 && value <= i32::max_value() as i64 {
| ~~~
error: usage of a legacy numeric method
--> external/rust/crates/libsqlite3-sys/android/build.rs:10:62
|
10 | if value >= i32::min_value() as i64 && value <= i32::max_value() as i64 {
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
10 | if value >= i32::min_value() as i64 && value <= i32::MAX as i64 {
| ~~~
Bug: http://b/346588808
Test: ./toolchain/android_rust/tools/test_compiler.py --prebuilt-path dist/rust-linux.tar.xz --target aosp_cf_x86_64_phone --image --reuse-prebuilt
Change-Id: I2315e2a0c2120e5b12cb348c5184dfa1e3d1d307
diff --git a/android/build.rs b/android/build.rs
index 5107974..473897f 100644
--- a/android/build.rs
+++ b/android/build.rs
@@ -7,7 +7,7 @@
impl ParseCallbacks for SqliteTypeChooser {
fn int_macro(&self, _name: &str, value: i64) -> Option<IntKind> {
- if value >= i32::min_value() as i64 && value <= i32::max_value() as i64 {
+ if value >= i32::MIN as i64 && value <= i32::MAX as i64 {
Some(IntKind::I32)
} else {
None