diff options
author | Hamir Mahal <hamirmahal@gmail.com> | 2024-10-06 09:34:41 -0700 |
---|---|---|
committer | Hamir Mahal <hamirmahal@gmail.com> | 2024-10-06 09:34:41 -0700 |
commit | 87f230a66e5aef0cc87a5bb5202758f0a5459714 (patch) | |
tree | 587f7c46077b2cf5b1370dba09aab26241db4c25 | |
parent | 4bdee80afa3db69c080ebc6ff977ee18e277da12 (diff) |
fix: formatting in `src/` and `tests/`
-rw-r--r-- | src/filter/time.rs | 24 | ||||
-rw-r--r-- | src/walk.rs | 4 | ||||
-rw-r--r-- | tests/tests.rs | 5 |
3 files changed, 11 insertions, 22 deletions
diff --git a/src/filter/time.rs b/src/filter/time.rs index 02bbad0..cd17542 100644 --- a/src/filter/time.rs +++ b/src/filter/time.rs @@ -148,21 +148,15 @@ mod tests { let t1s_later = ref_time + Duration::from_secs(1); // Timestamp only supported via '@' prefix assert!(TimeFilter::before(&ref_time, &ref_timestamp.to_string()).is_none()); - assert!( - TimeFilter::before(&ref_time, &format!("@{ref_timestamp}")) - .unwrap() - .applies_to(&t1m_ago) - ); - assert!( - !TimeFilter::before(&ref_time, &format!("@{ref_timestamp}")) - .unwrap() - .applies_to(&t1s_later) - ); - assert!( - !TimeFilter::after(&ref_time, &format!("@{ref_timestamp}")) - .unwrap() - .applies_to(&t1m_ago) - ); + assert!(TimeFilter::before(&ref_time, &format!("@{ref_timestamp}")) + .unwrap() + .applies_to(&t1m_ago)); + assert!(!TimeFilter::before(&ref_time, &format!("@{ref_timestamp}")) + .unwrap() + .applies_to(&t1s_later)); + assert!(!TimeFilter::after(&ref_time, &format!("@{ref_timestamp}")) + .unwrap() + .applies_to(&t1m_ago)); assert!(TimeFilter::after(&ref_time, &format!("@{ref_timestamp}")) .unwrap() .applies_to(&t1s_later)); diff --git a/src/walk.rs b/src/walk.rs index 45d949e..a98bdff 100644 --- a/src/walk.rs +++ b/src/walk.rs @@ -376,9 +376,7 @@ impl WorkerState { match result { Some(ignore::Error::Partial(_)) => (), Some(err) => { - print_error(format!( - "Malformed pattern in global ignore file. {err}." - )); + print_error(format!("Malformed pattern in global ignore file. {err}.")); } None => (), } diff --git a/tests/tests.rs b/tests/tests.rs index bc25c73..81010cf 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -595,10 +595,7 @@ fn test_full_path() { let prefix = escape(&root.to_string_lossy()); te.assert_output( - &[ - "--full-path", - &format!("^{prefix}.*three.*foo$"), - ], + &["--full-path", &format!("^{prefix}.*three.*foo$")], "one/two/three/d.foo one/two/three/directory_foo/", ); |