Importing rustc-1.66.0
Test: ./build.py --lto=thin
Bug: 263153841
Change-Id: I36050e4015d71a3dab9097947b43644e09c4c648
diff --git a/libs/apexutil/src/lib.rs b/libs/apexutil/src/lib.rs
index 698d93a..8a934e2 100644
--- a/libs/apexutil/src/lib.rs
+++ b/libs/apexutil/src/lib.rs
@@ -144,7 +144,7 @@
let res = verify("tests/data/test.apex").unwrap();
// The expected hex is generated when we ran the method the first time.
assert_eq!(
- hex::encode(&res.root_digest),
+ hex::encode(res.root_digest),
"fe11ab17da0a3a738b54bdc3a13f6139cbdf91ec32f001f8d4bbbf8938e04e39"
);
}
@@ -153,7 +153,7 @@
fn payload_vbmeta_has_valid_image_hash() {
let result = get_payload_vbmeta_image_hash("tests/data/test.apex").unwrap();
assert_eq!(
- hex::encode(&result),
+ hex::encode(result),
"296e32a76544de9da01713e471403ab4667705ad527bb4f1fac0cf61e7ce122d"
);
}
diff --git a/libs/apkverify/src/ziputil.rs b/libs/apkverify/src/ziputil.rs
index eb2826a..cc8bc58 100644
--- a/libs/apkverify/src/ziputil.rs
+++ b/libs/apkverify/src/ziputil.rs
@@ -46,7 +46,7 @@
reader = archive.into_inner();
// the current position should point EOCD offset
let eocd_offset = reader.seek(SeekFrom::Current(0))? as u32;
- let mut eocd = vec![0u8; eocd_size as usize];
+ let mut eocd = vec![0u8; eocd_size];
reader.read_exact(&mut eocd)?;
ensure!(
(&eocd[0..]).get_u32_le() == EOCD_SIGNATURE,
diff --git a/libs/devicemapper/src/lib.rs b/libs/devicemapper/src/lib.rs
index 9069eb2..4cf4e99 100644
--- a/libs/devicemapper/src/lib.rs
+++ b/libs/devicemapper/src/lib.rs
@@ -226,7 +226,7 @@
let context = Context::new(0);
let now = SystemTime::now().duration_since(UNIX_EPOCH)?;
- let ts = Timestamp::from_unix(&context, now.as_secs(), now.subsec_nanos());
+ let ts = Timestamp::from_unix(context, now.as_secs(), now.subsec_nanos());
let uuid = Uuid::new_v1(ts, node_id)?;
Ok(String::from(uuid.to_hyphenated().encode_lower(&mut Uuid::encode_buffer())))
}
diff --git a/libs/devicemapper/src/loopdevice.rs b/libs/devicemapper/src/loopdevice.rs
index 5533e17..16b5b65 100644
--- a/libs/devicemapper/src/loopdevice.rs
+++ b/libs/devicemapper/src/loopdevice.rs
@@ -172,13 +172,13 @@
fn is_direct_io(dev: &Path) -> bool {
let dio = Path::new("/sys/block").join(dev.file_name().unwrap()).join("loop/dio");
- "1" == fs::read_to_string(&dio).unwrap().trim()
+ "1" == fs::read_to_string(dio).unwrap().trim()
}
// kernel exposes /sys/block/loop*/ro which gives the read-only value
fn is_direct_io_writable(dev: &Path) -> bool {
let ro = Path::new("/sys/block").join(dev.file_name().unwrap()).join("ro");
- "0" == fs::read_to_string(&ro).unwrap().trim()
+ "0" == fs::read_to_string(ro).unwrap().trim()
}
#[test]