Skip to content

Commit b73f43f

Browse files
authored
Merge pull request #296 from fox0/clippy--manual_pattern_char_comparison
Fix clippy::manual_pattern_char_comparison
2 parents 895604f + cbba20a commit b73f43f

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

awk/src/interpreter/mod.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,7 @@ fn swap_with_default<T: Default>(value: &mut T) -> T {
104104

105105
fn maybe_numeric_string<S: Into<AwkString>>(str: S) -> AwkString {
106106
let mut str = str.into();
107-
let numeric_string = is_valid_number(
108-
str.as_str()
109-
.trim()
110-
.trim_start_matches(|c| c == '+' || c == '-'),
111-
);
107+
let numeric_string = is_valid_number(str.as_str().trim().trim_start_matches(['+', '-']));
112108
str.is_numeric = numeric_string;
113109
str
114110
}

sys/ps.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ fn parse_output_format<'a>(
6565
posix_fields: &'a HashMap<&'a str, &'a str>,
6666
) -> Vec<&'a str> {
6767
format
68-
.split(|c| c == ' ' || c == ',')
68+
.split([' ', ','])
6969
.map(|s| {
7070
let field = s.split('=').next().unwrap_or("").trim();
7171
if posix_fields.contains_key(field) {

0 commit comments

Comments
 (0)