From 6829c7f6733e224bccec9d241d0e62b08e9a0d3b Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 9 Sep 2023 18:57:38 +0200 Subject: [PATCH] Fix formatting after #135 --- src/contains_regex.rs | 24 +++++++++++------------- src/html_root_url.rs | 4 +--- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/contains_regex.rs b/src/contains_regex.rs index 4e47733..6e47acb 100644 --- a/src/contains_regex.rs +++ b/src/contains_regex.rs @@ -149,9 +149,7 @@ pub fn check_only_contains_regex( } if !has_match { - return Err(format!( - "{path} ... found no matches for \"{template}\"" - )); + return Err(format!("{path} ... found no matches for \"{template}\"")); } if errors > 0 { @@ -173,12 +171,12 @@ mod tests { assert_eq!( check_contains_regex("README.md", "Version {version} [ups", "foobar", "1.2.3"), Err([ - r"could not parse template: regex parse error:", - r" Version 1\.2\.3 [ups", - r" ^", - r"error: unclosed character class" - ] - .join("\n")) + r"could not parse template: regex parse error:", + r" Version 1\.2\.3 [ups", + r" ^", + r"error: unclosed character class" + ] + .join("\n")) ) } @@ -202,10 +200,10 @@ mod tests { "1.2.3" ), Err([ - r#"could not find "escaped: foo\*bar-1\.2\.3,"#, - r#"not escaped: foo*bar-1.2.3" in README.md"# - ] - .join(" ")) + r#"could not find "escaped: foo\*bar-1\.2\.3,"#, + r#"not escaped: foo*bar-1.2.3" in README.md"# + ] + .join(" ")) ) } diff --git a/src/html_root_url.rs b/src/html_root_url.rs index 1a4f840..1ae0535 100644 --- a/src/html_root_url.rs +++ b/src/html_root_url.rs @@ -38,9 +38,7 @@ fn url_matches(value: &str, pkg_name: &str, version: &Version) -> Result<()> { // Finally, we check that the package name and version matches. if name != pkg_name { - Err(format!( - "expected package \"{pkg_name}\", found \"{name}\"" - )) + Err(format!("expected package \"{pkg_name}\", found \"{name}\"")) } else { // The Rust API Guidelines[1] suggest using an exact version // number, but we have relaxed this a little and allow the