Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions awk/src/interpreter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,7 @@ fn swap_with_default<T: Default>(value: &mut T) -> T {

fn maybe_numeric_string<S: Into<AwkString>>(str: S) -> AwkString {
let mut str = str.into();
let numeric_string = is_valid_number(
str.as_str()
.trim()
.trim_start_matches(|c| c == '+' || c == '-'),
);
let numeric_string = is_valid_number(str.as_str().trim().trim_start_matches(['+', '-']));
str.is_numeric = numeric_string;
str
}
Expand Down
2 changes: 1 addition & 1 deletion sys/ps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ fn parse_output_format<'a>(
posix_fields: &'a HashMap<&'a str, &'a str>,
) -> Vec<&'a str> {
format
.split(|c| c == ' ' || c == ',')
.split([' ', ','])
.map(|s| {
let field = s.split('=').next().unwrap_or("").trim();
if posix_fields.contains_key(field) {
Expand Down