treefmt-check
checks.aarch64-linux.formatting
· build #116
· raw
1tribuchet: building on eliza2treefmt v2.5.0traversed 724 files3emitted 298 files for processing4formatted 298 files (3 changed) in 902ms5 M crates/tinc-crypto/src/invite.rs6 M crates/tinc-tools/src/cmd/invite.rs7 M crates/tinc-tools/src/cmd/join/tests.rs8diff --git a/crates/tinc-crypto/src/invite.rs b/crates/tinc-crypto/src/invite.rs9index 39291b9..82c4fd2 10064410--- a/crates/tinc-crypto/src/invite.rs11+++ b/crates/tinc-crypto/src/invite.rs12@@ -214,12 +214,18 @@ mod tests {13 14 #[test]15 fn replace_marker() {16- assert_eq!(strip_replace_marker(b"Name = a\n"), (None, &b"Name = a\n"[..]));17+ assert_eq!(18+ strip_replace_marker(b"Name = a\n"),19+ (None, &b"Name = a\n"[..])20+ );21 assert_eq!(22 strip_replace_marker(b"#replace abc\nName = a\n"),23 (Some(&b"abc"[..]), &b"Name = a\n"[..])24 );25- assert_eq!(strip_replace_marker(b"#replace abc"), (Some(&b"abc"[..]), &b""[..]));26+ assert_eq!(27+ strip_replace_marker(b"#replace abc"),28+ (Some(&b"abc"[..]), &b""[..])29+ );30 }31 32 /// `key_hash(pk) == fingerprint_hash(fingerprint(pk))`. The KAT33diff --git a/crates/tinc-tools/src/cmd/invite.rs b/crates/tinc-tools/src/cmd/invite.rs34index 140036a..44153e9 10064435--- a/crates/tinc-tools/src/cmd/invite.rs36+++ b/crates/tinc-tools/src/cmd/invite.rs37@@ -54,8 +54,8 @@ use std::time::{Duration, SystemTime};38 39 use rand_core::Rng;40 use tinc_conf::Config;41-use tinc_crypto::invite::{COOKIE_LEN, REPLACE_MARKER, SLUG_PART_LEN, build_slug, cookie_filename};42 use tinc_crypto::b64;43+use tinc_crypto::invite::{COOKIE_LEN, REPLACE_MARKER, SLUG_PART_LEN, build_slug, cookie_filename};44 use tinc_crypto::os_rng;45 use tinc_crypto::sign::SigningKey;46 use zeroize::Zeroizing;47@@ -139,7 +139,10 @@ pub fn invite(48 let file = hosts.file(invitee);49 let cfg = Config::read(&file).map_err(|e| CmdError::BadInput(e.to_string()))?;50 let key = keypair::load_public_from_config(&cfg, &file).ok_or_else(|| {51- CmdError::BadInput(format!("{} has no Ed25519 public key to replace", file.display()))52+ CmdError::BadInput(format!(53+ "{} has no Ed25519 public key to replace",54+ file.display()55+ ))56 })?;57 Some(b64::encode(&key))58 } else {59@@ -981,10 +984,17 @@ mod tests {60 let paths = cd.paths().clone();61 init_with_address(&paths, "alice", "myhost");62 let old = b64::encode(&[7u8; 32]);63- let cd = cd.with_overlay_host("bob", &format!("Subnet = 10.0.0.7\nEd25519PublicKey = {old}\n"));64+ let cd = cd.with_overlay_host(65+ "bob",66+ &format!("Subnet = 10.0.0.7\nEd25519PublicKey = {old}\n"),67+ );68 let paths = cd.paths().clone();69 let script = cd.confbase().join("invitation-created");70- fs::write(&script, "#!/bin/sh\necho \"# $REPLACE\" >> \"$INVITATION_FILE\"\n").unwrap();71+ fs::write(72+ &script,73+ "#!/bin/sh\necho \"# $REPLACE\" >> \"$INVITATION_FILE\"\n",74+ )75+ .unwrap();76 fs::set_permissions(&script, fs::Permissions::from_mode(0o755)).unwrap();77 78 invite(&paths, None, "bob", true, SystemTime::now()).unwrap();79@@ -1010,7 +1020,10 @@ mod tests {80 ("rsa", "no Ed25519 public key"),81 ] {82 let err = invite(&paths, None, who, true, SystemTime::now()).unwrap_err();83- assert!(matches!(&err, CmdError::BadInput(m) if m.contains(want)), "{who}: {err}");84+ assert!(85+ matches!(&err, CmdError::BadInput(m) if m.contains(want)),86+ "{who}: {err}"87+ );88 }89 }90 91diff --git a/crates/tinc-tools/src/cmd/join/tests.rs b/crates/tinc-tools/src/cmd/join/tests.rs92index 03087db..084f6f0 10064493--- a/crates/tinc-tools/src/cmd/join/tests.rs94+++ b/crates/tinc-tools/src/cmd/join/tests.rs95@@ -496,7 +496,8 @@ fn invite_join_roundtrip_in_process() {96 .append_conf("Mode = switch\n");97 let inviter = inviter_cd.paths();98 99- let inv_result = invite::invite(inviter, Some("acme"), "bob", false, SystemTime::now()).unwrap();100+ let inv_result =101+ invite::invite(inviter, Some("acme"), "bob", false, SystemTime::now()).unwrap();102 let parsed = parse_url(&inv_result.url).unwrap();103 104 // Load invitation key. Both the server stub and the joiner's