summaryrefslogtreecommitdiff
path: root/test_util/src
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2020-11-28 06:47:35 +1100
committerGitHub <noreply@github.com>2020-11-28 06:47:35 +1100
commite2858d0bbb13dae202e7da9ee7bbb81916349d1e (patch)
treec47084e73a9d4c7a852546374069b1aa176c3265 /test_util/src
parent40bf26b37d82c7a85c3d6a54947fc441eb5e6946 (diff)
chore: clippy future cleanups (#8514)
Diffstat (limited to 'test_util/src')
-rw-r--r--test_util/src/lib.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/test_util/src/lib.rs b/test_util/src/lib.rs
index ab5e1080c..a45581491 100644
--- a/test_util/src/lib.rs
+++ b/test_util/src/lib.rs
@@ -931,7 +931,7 @@ pub fn pattern_match(pattern: &str, s: &str, wildcard: &str) -> bool {
// needs to be pre-pended so it can safely match anything or nothing and
// continue matching.
if pattern.lines().next() == Some(wildcard) {
- s.insert_str(0, "\n");
+ s.insert(0, '\n');
}
let mut t = s.split_at(parts[0].len());
@@ -941,7 +941,7 @@ pub fn pattern_match(pattern: &str, s: &str, wildcard: &str) -> bool {
continue;
}
dbg!(part, i);
- if i == parts.len() - 1 && (*part == "" || *part == "\n") {
+ if i == parts.len() - 1 && (part.is_empty() || *part == "\n") {
dbg!("exit 1 true", i);
return true;
}
@@ -1071,7 +1071,7 @@ pub fn parse_strace_output(output: &str) -> HashMap<String, StraceOutput> {
let len = syscall_fields.len();
let syscall_name = syscall_fields.last().unwrap();
- if 5 <= len && len <= 6 {
+ if (5..=6).contains(&len) {
summary.insert(
syscall_name.to_string(),
StraceOutput {