Skip to content

Commit

Permalink
fix: formatting in src/ and tests/
Browse files Browse the repository at this point in the history
  • Loading branch information
hamirmahal committed Oct 6, 2024
1 parent 4bdee80 commit 87f230a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 22 deletions.
24 changes: 9 additions & 15 deletions src/filter/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
4 changes: 1 addition & 3 deletions src/walk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 => (),
}
Expand Down
5 changes: 1 addition & 4 deletions tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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/",
);
Expand Down

0 comments on commit 87f230a

Please sign in to comment.