Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions src/contains_regex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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"))
)
}

Expand All @@ -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(" "))
)
}

Expand Down
4 changes: 1 addition & 3 deletions src/html_root_url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down