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