summaryrefslogtreecommitdiffstats
path: root/tests/vcs.rs
diff options
context:
space:
mode:
authoraur-build <aur-build@localhost>2026-11-22 10:36:24 +0000
committeraur-build <aur-build@localhost>2026-11-22 10:36:24 +0000
commit3dc71b2f5160ef9bd46143eed0edb5d2557b58e6 (patch)
tree7cc7169181b4bdd73fd8817f8c1d7cce6e6998a8 /tests/vcs.rs
parent9dc9087d89891c6e5ef7e5dc084dd13c8611843e (diff)
downloadaur-build-3dc71b2f5160ef9bd46143eed0edb5d2557b58e6.tar.gz
aur-build-3dc71b2f5160ef9bd46143eed0edb5d2557b58e6.zip
rustfmt,lints: pin the formatting, adopt the idiom lints, pay them off
rustfmt.toml fixes the shape the tree is written in (120 columns, small items kept on one line) and one canonical pass makes it the truth. [lints.clippy] names the idiom lints worth enforcing and leaves out the two that would add doc-comment boilerplate rather than remove it. The tree pays them off here: write!/writeln! instead of push_str(&format!()), let-else instead of match-on-Option, borrows where a thread entry point only reads what it owns, no `&self` on a Copy state and no `self` nobody reads. ops::to_prometheus gains one gauge helper: a metric's HELP, TYPE and value are now emitted by the same call instead of three.
Diffstat (limited to 'tests/vcs.rs')
-rw-r--r--tests/vcs.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/tests/vcs.rs b/tests/vcs.rs
index 52f4372..d0f0d60 100644
--- a/tests/vcs.rs
+++ b/tests/vcs.rs
@@ -47,10 +47,7 @@ fn stage_a_respects_a_tag_pin() {
fx.upstream_commit("upstream: moved past the tag\n");
let (outcome, _) = detect_and_take(&env, "git-tagged");
- assert!(
- matches!(outcome, detect::Outcome::NoChange),
- "a tag pin does not drift with the branch: {outcome:?}"
- );
+ assert!(matches!(outcome, detect::Outcome::NoChange), "a tag pin does not drift with the branch: {outcome:?}");
}
#[test]
@@ -193,10 +190,7 @@ fn a_moved_tip_with_an_unchanged_pkgver_is_a_notice_not_a_candidate() {
assert_eq!(notices[0].kind, notice_kind::PIN_DRIFT);
let detail = notices[0].detail_json.clone();
assert!(detail.contains("nothing publishable"), "{detail}");
- assert_eq!(
- env.query_i64("SELECT count(*) FROM package WHERE state='in_index'", &[]),
- Some(1)
- );
+ assert_eq!(env.query_i64("SELECT count(*) FROM package WHERE state='in_index'", &[]), Some(1));
}
#[test]