Formatting

This commit is contained in:
Connor Johnstone
2026-03-18 15:36:54 -04:00
parent 4400cbc1cb
commit 5957d69e7d
7 changed files with 107 additions and 75 deletions

View File

@@ -45,8 +45,8 @@ pub fn normalize(s: &str) -> String {
/// Escape special characters for MusicBrainz Lucene query syntax.
pub fn escape_lucene(s: &str) -> String {
let special = [
'+', '-', '&', '|', '!', '(', ')', '{', '}', '[', ']', '^', '"', '~', '*', '?', ':',
'\\', '/',
'+', '-', '&', '|', '!', '(', ')', '{', '}', '[', ']', '^', '"', '~', '*', '?', ':', '\\',
'/',
];
let mut result = String::with_capacity(s.len());
for c in s.chars() {
@@ -72,7 +72,10 @@ mod tests {
fn test_normalize_strips_official_video() {
assert_eq!(normalize("Time (Official Video)"), "time");
assert_eq!(normalize("Money (Official Music Video)"), "money");
assert_eq!(normalize("Comfortably Numb (Official Audio)"), "comfortably numb");
assert_eq!(
normalize("Comfortably Numb (Official Audio)"),
"comfortably numb"
);
}
#[test]