Formatting
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user