this derivation will be built: /nix/store/sl5i6pai9cpnza802956pbcdn4kxdaxf-treefmt-check.drv building '/nix/store/sl5i6pai9cpnza802956pbcdn4kxdaxf-treefmt-check.drv' on 'ssh-ng://nix@eliza' building '/nix/store/sl5i6pai9cpnza802956pbcdn4kxdaxf-treefmt-check.drv' treefmt-check> treefmt v2.5.0traversed 28 files treefmt-check> emitted 17 files for processing treefmt-check> formatted 17 files (2 changed) in 64ms treefmt-check> M src/render.rs treefmt-check> M tests/snapshot_test.rs treefmt-check> diff --git a/src/render.rs b/src/render.rs treefmt-check> index 8643320..b5fa250 100644 treefmt-check> --- a/src/render.rs treefmt-check> +++ b/src/render.rs treefmt-check> @@ -497,8 +497,11 @@ impl Renderer { treefmt-check> // matching on UnicodeWords better tokenizes words, paths, and other treefmt-check> // non-space-delimited items, which gets us much more reliable inline treefmt-check> // highlights treefmt-check> - for change in diff.iter_inline_changes_with_options(op, treefmt-check> - *similar::InlineChangeOptions::new().mode(similar::InlineChangeMode::UnicodeWords)) { treefmt-check> + for change in diff.iter_inline_changes_with_options( treefmt-check> + op, treefmt-check> + *similar::InlineChangeOptions::new() treefmt-check> + .mode(similar::InlineChangeMode::UnicodeWords), treefmt-check> + ) { treefmt-check> let (color, sign): (&[u8], &[u8]) = match change.tag() { treefmt-check> ChangeTag::Delete => (self.red(), b"- "), treefmt-check> ChangeTag::Insert => (self.green(), b"+ "), treefmt-check> diff --git a/tests/snapshot_test.rs b/tests/snapshot_test.rs treefmt-check> index 027d45d..b04ddbb 100644 treefmt-check> --- a/tests/snapshot_test.rs treefmt-check> +++ b/tests/snapshot_test.rs treefmt-check> @@ -14,13 +14,18 @@ fn normalize_readable_nix_output(output: &str, store_dir: &str) -> String { treefmt-check> treefmt-check> // match against the file path diffs, which are never inline highlighted treefmt-check> let re = regex::Regex::new(r"^\-\-\- /nix/store/[a-z0-9]{32}-").unwrap(); treefmt-check> - normalized = re.replace_all(&normalized, r"--- /nix/store/HASH-").to_string(); treefmt-check> + normalized = re treefmt-check> + .replace_all(&normalized, r"--- /nix/store/HASH-") treefmt-check> + .to_string(); treefmt-check> treefmt-check> let re = regex::Regex::new(r"\+\+\+ /nix/store/[a-z0-9]{32}-").unwrap(); treefmt-check> - normalized = re.replace_all(&normalized, r"+++ /nix/store/HASH-").to_string(); treefmt-check> + normalized = re treefmt-check> + .replace_all(&normalized, r"+++ /nix/store/HASH-") treefmt-check> + .to_string(); treefmt-check> treefmt-check> let re = regex::Regex::new(r"/nix/store/()[a-z0-9]{32}()-").unwrap(); treefmt-check> - re.replace_all(&normalized, r"/nix/store/HASH-").to_string() treefmt-check> + re.replace_all(&normalized, r"/nix/store/HASH-") treefmt-check> + .to_string() treefmt-check> } treefmt-check> treefmt-check> // Normalize store paths and hashes for consistent snapshots treefmt-check> @@ -33,7 +38,6 @@ fn normalize_nix_output(output: &str, store_dir: &str) -> String { treefmt-check> re.replace_all(&normalized, "/nix/store/HASH-").to_string() treefmt-check> } treefmt-check> treefmt-check> - treefmt-check> fn run_nix_diff(file1: &str, file2: &str) -> String { treefmt-check> let tests_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("tests"); treefmt-check> let (nix_root, env_vars) = setup_nix_env(); error: build of '/nix/store/sl5i6pai9cpnza802956pbcdn4kxdaxf-treefmt-check.drv' on 'ssh-ng://nix@eliza' failed: Cannot build '/nix/store/sl5i6pai9cpnza802956pbcdn4kxdaxf-treefmt-check.drv'. Reason: builder failed with exit code 1. Output paths: /nix/store/hgl4xj176k9lyjn5pppa4fm0n7l8laz9-treefmt-check Last 25 log lines: > + normalized = re > + .replace_all(&normalized, r"--- /nix/store/HASH-") > + .to_string(); > > let re = regex::Regex::new(r"\+\+\+ /nix/store/[a-z0-9]{32}-").unwrap(); > - normalized = re.replace_all(&normalized, r"+++ /nix/store/HASH-").to_string(); > + normalized = re > + .replace_all(&normalized, r"+++ /nix/store/HASH-") > + .to_string(); > > let re = regex::Regex::new(r"/nix/store/()[a-z0-9]{32}()-").unwrap(); > - re.replace_all(&normalized, r"/nix/store/HASH-").to_string() > + re.replace_all(&normalized, r"/nix/store/HASH-") > + .to_string() > } > > // Normalize store paths and hashes for consistent snapshots > @@ -33,7 +38,6 @@ fn normalize_nix_output(output: &str, store_dir: &str) -> String { > re.replace_all(&normalized, "/nix/store/HASH-").to_string() > } > > - > fn run_nix_diff(file1: &str, file2: &str) -> String { > let tests_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("tests"); > let (nix_root, env_vars) = setup_nix_env(); For full logs, run: nix log /nix/store/sl5i6pai9cpnza802956pbcdn4kxdaxf-treefmt-check.drv error: Cannot build '/nix/store/sl5i6pai9cpnza802956pbcdn4kxdaxf-treefmt-check.drv'. Reason: builder failed with exit code 1. Output paths: /nix/store/hgl4xj176k9lyjn5pppa4fm0n7l8laz9-treefmt-check