Skip to content

Commit 4c5e9bc

Browse files
committed
fix clippy warnings:
manual_range_contains needless_lifetimes
1 parent d5556ae commit 4c5e9bc

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

crates/cargo-platform/src/cfg.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,11 +298,11 @@ impl<'a> Iterator for Tokenizer<'a> {
298298
}
299299

300300
fn is_ident_start(ch: char) -> bool {
301-
ch == '_' || ('a' <= ch && ch <= 'z') || ('A' <= ch && ch <= 'Z')
301+
ch == '_' || ('a'..='z').contains(&ch) || ('A'..='Z').contains(&ch)
302302
}
303303

304304
fn is_ident_rest(ch: char) -> bool {
305-
is_ident_start(ch) || ('0' <= ch && ch <= '9')
305+
is_ident_start(ch) || ('0'..='9').contains(&ch)
306306
}
307307

308308
impl<'a> Token<'a> {

src/cargo/core/package.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ impl<'cfg> PackageSet<'cfg> {
430430
})
431431
}
432432

433-
pub fn package_ids<'a>(&'a self) -> impl Iterator<Item = PackageId> + 'a {
433+
pub fn package_ids(&self) -> impl Iterator<Item = PackageId> + '_ {
434434
self.packages.keys().cloned()
435435
}
436436

src/cargo/core/resolver/resolve.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ unable to verify that `{0}` is the same as when the lockfile was generated
236236
self.graph.sort()
237237
}
238238

239-
pub fn iter<'a>(&'a self) -> impl Iterator<Item = PackageId> + 'a {
239+
pub fn iter(&self) -> impl Iterator<Item = PackageId> + '_ {
240240
self.graph.iter().cloned()
241241
}
242242

src/cargo/core/resolver/types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ impl DepsFrame {
184184
.unwrap_or(0)
185185
}
186186

187-
pub fn flatten<'a>(&'a self) -> impl Iterator<Item = (PackageId, Dependency)> + 'a {
187+
pub fn flatten(&self) -> impl Iterator<Item = (PackageId, Dependency)> + '_ {
188188
self.remaining_siblings
189189
.clone()
190190
.map(move |(d, _, _)| (self.parent.package_id(), d))
@@ -258,7 +258,7 @@ impl RemainingDeps {
258258
}
259259
None
260260
}
261-
pub fn iter<'a>(&'a mut self) -> impl Iterator<Item = (PackageId, Dependency)> + 'a {
261+
pub fn iter(&mut self) -> impl Iterator<Item = (PackageId, Dependency)> + '_ {
262262
self.data.iter().flat_map(|(other, _)| other.flatten())
263263
}
264264
}

src/cargo/sources/registry/index.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ impl IndexSummary {
747747
}
748748
}
749749

750-
fn split<'a>(haystack: &'a [u8], needle: u8) -> impl Iterator<Item = &'a [u8]> + 'a {
750+
fn split(haystack: &[u8], needle: u8) -> impl Iterator<Item = &[u8]> + '_ {
751751
struct Split<'a> {
752752
haystack: &'a [u8],
753753
needle: u8,

src/cargo/util/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ pub fn is_simple_exit_code(code: i32) -> bool {
470470
// codes are very large. This is just a rough
471471
// approximation of which codes are "normal" and which
472472
// ones are abnormal termination.
473-
code >= 0 && code <= 127
473+
(0..=127).contains(&code)
474474
}
475475

476476
pub fn internal<S: fmt::Display>(error: S) -> anyhow::Error {

0 commit comments

Comments
 (0)