Skip to content
Myr

fix: formatting in `src/` and `tests/`

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Hamir Mahal · committed by Hamir Mahal · parent 4bdee80 · Browse files · 3 files+11 added−22 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+11 added−22 removed

  • tests:+1 added−4 removed
  • other:+10 added−18 removed

3 files+11 added−22 removed

modified:src/filter/time.rs+9 added-15 removed
146 unmodified lines
147 let t1m_ago = ref_time - Duration::from_secs(60);148 let t1s_later = ref_time + Duration::from_secs(1);149 // Timestamp only supported via '@' prefix150 assert!(TimeFilter::before(&ref_time, &ref_timestamp.to_string()).is_none());151 assert!(152 TimeFilter::before(&ref_time, &format!("@{ref_timestamp}"))153 .unwrap()154 .applies_to(&t1m_ago)155 );156 assert!(157 !TimeFilter::before(&ref_time, &format!("@{ref_timestamp}"))158 .unwrap()159 .applies_to(&t1s_later)160 );161 assert!(162 !TimeFilter::after(&ref_time, &format!("@{ref_timestamp}"))163 .unwrap()164 .applies_to(&t1m_ago)165 );151 assert!(TimeFilter::before(&ref_time, &format!("@{ref_timestamp}"))152 .unwrap()153 .applies_to(&t1m_ago));154 assert!(!TimeFilter::before(&ref_time, &format!("@{ref_timestamp}"))155 .unwrap()156 .applies_to(&t1s_later));157 assert!(!TimeFilter::after(&ref_time, &format!("@{ref_timestamp}"))158 .unwrap()159 .applies_to(&t1m_ago));160 assert!(TimeFilter::after(&ref_time, &format!("@{ref_timestamp}"))161 .unwrap()162 .applies_to(&t1s_later));163 }
1 unmodified line
modified:src/walk.rs+1 added-3 removed
374 unmodified lines
375 let result = builder.add_ignore(global_ignore_file);376 match result {377 Some(ignore::Error::Partial(_)) => (),378 Some(err) => {379 print_error(format!(380 "Malformed pattern in global ignore file. {err}."381 ));379 print_error(format!("Malformed pattern in global ignore file. {err}."));380 }381 None => (),382 }383 }
287 unmodified lines
modified:tests/tests.rs+1 added-4 removed
593 unmodified lines
594 let root = te.system_root();595 let prefix = escape(&root.to_string_lossy());596597 te.assert_output(598 &[599 "--full-path",600 &format!("^{prefix}.*three.*foo$"),601 ],598 &["--full-path", &format!("^{prefix}.*three.*foo$")],599 "one/two/three/d.foo600 one/two/three/directory_foo/",601 );602}
2088 unmodified lines