You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The search_case_insensitive example in chapter 12.5 should mention that this solution of using to_lowercase for case insensitive matching is not correct for Unicode and is only used to make the example simple.
For example this test fails when using to_lowercase:
#[test]
fn case_insensitive_unicode() {
let query = "weiß";
let contents = "WEISS";
assert_eq!(
vec!["WEISS"],
search_case_insensitive(query, contents)
);
}
ps. Correct solution would be to use case folding, but I don't know if that is available in Rust.
The text was updated successfully, but these errors were encountered:
The
search_case_insensitive
example in chapter 12.5 should mention that this solution of usingto_lowercase
for case insensitive matching is not correct for Unicode and is only used to make the example simple.For example this test fails when using
to_lowercase
:ps. Correct solution would be to use case folding, but I don't know if that is available in Rust.
The text was updated successfully, but these errors were encountered: