Skip to content

Commit 61987d4

Browse files
committed
Auto merge of #554 - pietroalbini:clippy, r=pietroalbini
Fix Clippy for 1.48.0
2 parents 261696d + 137d379 commit 61987d4

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/runner/unstable_features.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fn parse_features(path: &Path) -> Fallible<Vec<String>> {
5353
let contents = ::std::fs::read_to_string(path)?;
5454
for (hash_idx, _) in contents.match_indices('#') {
5555
let contents = &contents[hash_idx + 1..];
56-
let contents = eat_token(Some(contents), "!").or_else(|| Some(contents));
56+
let contents = eat_token(Some(contents), "!").or(Some(contents));
5757
let contents = eat_token(contents, "[");
5858
let contents = eat_token(contents, "feature");
5959
let new_features = parse_list(contents, "(", ")");
@@ -72,13 +72,7 @@ fn is_hidden(entry: &DirEntry) -> bool {
7272
}
7373

7474
fn eat_token<'a>(s: Option<&'a str>, tok: &str) -> Option<&'a str> {
75-
eat_whitespace(s).and_then(|s| {
76-
if s.starts_with(tok) {
77-
Some(&s[tok.len()..])
78-
} else {
79-
None
80-
}
81-
})
75+
eat_whitespace(s).and_then(|s| s.strip_prefix(tok))
8276
}
8377

8478
fn eat_whitespace(s: Option<&str>) -> Option<&str> {

0 commit comments

Comments
 (0)