From 91a9e561145d8481949f713b5e4d0dc664e01d09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mikrut?= <41945903+qarmin@users.noreply.github.com> Date: Sun, 27 Feb 2022 14:35:44 +0100 Subject: [PATCH] Catch also square brackets in approximate comparsion (#641) --- czkawka_core/src/same_music.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/czkawka_core/src/same_music.rs b/czkawka_core/src/same_music.rs index c6946ae..dcfa562 100644 --- a/czkawka_core/src/same_music.rs +++ b/czkawka_core/src/same_music.rs @@ -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 { @@ -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"); } }