Skip to content

Commit 6101b22

Browse files
committed
Fix new Rust 1.83 clippy lints
1 parent ffe3e34 commit 6101b22

File tree

6 files changed

+8
-12
lines changed

6 files changed

+8
-12
lines changed

apk/src/compiler/table.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ pub struct Entry<'a> {
144144
entry: &'a ResTableEntry,
145145
}
146146

147-
impl<'a> Entry<'a> {
147+
impl Entry<'_> {
148148
pub fn id(self) -> ResTableRef {
149149
self.id
150150
}

apk/src/res.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ impl Chunk {
932932
break;
933933
}
934934
}
935-
let s = String::from_utf16(unsafe { std::mem::transmute(buf.as_slice()) })?;
935+
let s = String::from_utf16(buf.as_slice())?;
936936
strings.push(s);
937937
}
938938
}

mvn/src/package.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ pub struct Artifact<'a> {
143143
pub version: &'a Version,
144144
}
145145

146-
impl<'a> Artifact<'a> {
146+
impl Artifact<'_> {
147147
pub fn file_name(self, ext: &str) -> String {
148148
format!(
149149
"{}-{}-{}.{}",
@@ -163,7 +163,7 @@ impl<'a> Artifact<'a> {
163163
}
164164
}
165165

166-
impl<'a> std::fmt::Display for Artifact<'a> {
166+
impl std::fmt::Display for Artifact<'_> {
167167
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
168168
write!(
169169
f,

mvn/src/pom.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@ pub struct Pom {
1414

1515
impl Pom {
1616
pub fn packaging(&self) -> &str {
17-
if let Some(s) = self.packaging.as_deref() {
18-
s
19-
} else {
20-
"jar"
21-
}
17+
self.packaging.as_deref().unwrap_or("jar")
2218
}
2319

2420
pub fn dependencies(&self) -> &[Dependency] {

xbuild/src/download.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub struct DownloadManager<'a> {
1515
client: Client,
1616
}
1717

18-
impl<'a> Download for DownloadManager<'a> {
18+
impl Download for DownloadManager<'_> {
1919
fn download(&self, url: &str, dest: &Path) -> Result<()> {
2020
let pb = ProgressBar::with_draw_target(Some(0), ProgressDrawTarget::stdout())
2121
.with_style(
@@ -233,7 +233,7 @@ impl WorkItem {
233233
}
234234
}
235235

236-
impl<'a> DownloadManager<'a> {
236+
impl DownloadManager<'_> {
237237
pub fn android_jar(&self) -> Result<()> {
238238
let dir = self.env.android_sdk();
239239
let sdk = self.env.target_sdk_version();

xcommon/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ fn find_cde_start_pos<R: Read + Seek>(reader: &mut R) -> Result<u64> {
248248
const CENTRAL_DIRECTORY_END_SIGNATURE: u32 = 0x06054b50;
249249
const HEADER_SIZE: u64 = 22;
250250
let file_length = reader.seek(SeekFrom::End(0))?;
251-
let search_upper_bound = file_length.saturating_sub(HEADER_SIZE + ::std::u16::MAX as u64);
251+
let search_upper_bound = file_length.saturating_sub(HEADER_SIZE + u16::MAX as u64);
252252
anyhow::ensure!(file_length >= HEADER_SIZE, "Invalid zip header");
253253
let mut pos = file_length - HEADER_SIZE;
254254
while pos >= search_upper_bound {

0 commit comments

Comments
 (0)