Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

w: fix two clippy warnings in tests #63

Merged
merged 1 commit into from
Apr 18, 2024
Merged
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
4 changes: 2 additions & 2 deletions tests/by-util/test_w.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
let output_lines = cmd.stdout_str().lines();

for line in output_lines {
let line_vec: Vec<String> = line.split_whitespace().map(|s| String::from(s)).collect();
let line_vec: Vec<String> = line.split_whitespace().map(String::from).collect();

Check warning on line 32 in tests/by-util/test_w.rs

View check run for this annotation

Codecov / codecov/patch

tests/by-util/test_w.rs#L32

Added line #L32 was not covered by tests
// Check the time formatting, this should be the third entry in list
// For now, we are just going to check that that length of time is 5 and it has a colon, else
// it is possible that a time can look like Fri13, so it can start with a letter and end
// with a number
assert!(
(line_vec[2].contains(":") && line_vec[2].chars().count() == 5)
(line_vec[2].contains(':') && line_vec[2].chars().count() == 5)
|| (line_vec[2].starts_with(char::is_alphabetic)
&& line_vec[2].ends_with(char::is_numeric)
&& line_vec[2].chars().count() == 5)
Expand Down