Skip to content

Commit

Permalink
Catch also square brackets in approximate comparsion (#641)
Browse files Browse the repository at this point in the history
  • Loading branch information
qarmin authored Feb 27, 2022
1 parent 3ce5d4a commit 91a9e56
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions czkawka_core/src/same_music.rs
Original file line number Diff line number Diff line change
Expand Up @@ -902,10 +902,10 @@ fn get_approximate_conversion(what: &mut String) {
let mut space_before = true;
for character in what.chars() {
match character {
'(' => {
'(' | '[' => {
tab_number += 1;
}
')' => {
')' | ']' => {
if tab_number == 0 {
// Nothing to do, not even save it to output
} else {
Expand Down Expand Up @@ -956,5 +956,9 @@ mod tests {
let mut what = " fsf.f. ".to_string();
get_approximate_conversion(&mut what);
assert_eq!(what, "fsf f");

let mut what = "Kekistan (feat. roman) [Mix on Mix]".to_string();
get_approximate_conversion(&mut what);
assert_eq!(what, "Kekistan");
}
}

0 comments on commit 91a9e56

Please sign in to comment.