diff --git a/Cargo.lock b/Cargo.lock index 6100233b90..b85cd85a5b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -465,16 +465,6 @@ dependencies = [ "thiserror 2.0.3", ] -[[package]] -name = "caseless" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808dab3318747be122cb31d36de18d4d1c81277a76f8332a02b81a3d73463d7f" -dependencies = [ - "regex", - "unicode-normalization", -] - [[package]] name = "cast" version = "0.3.0" @@ -3248,9 +3238,9 @@ version = "0.1.0" dependencies = [ "anyhow", "bitflags 1.3.2", - "caseless", "dogear", "error-support", + "icu_casemap", "idna", "interrupt-support", "lazy_static", @@ -4545,21 +4535,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" - [[package]] name = "tokio" version = "1.29.1" @@ -4814,15 +4789,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" -[[package]] -name = "unicode-normalization" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" -dependencies = [ - "tinyvec", -] - [[package]] name = "unicode-segmentation" version = "1.9.0" diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index d2c0d6a5bf..a2fee0e6e3 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -11,7 +11,6 @@ the details of which are reproduced below. * [MIT License: bincode](#mit-license-bincode) * [MIT License: bytes](#mit-license-bytes) * [MIT License: cargo_metadata, winnow](#mit-license-cargo_metadata-winnow) -* [MIT License: caseless](#mit-license-caseless) * [MIT License: core_maths](#mit-license-core_maths) * [MIT License: extend](#mit-license-extend) * [MIT License: generic-array](#mit-license-generic-array) @@ -582,11 +581,8 @@ The following text applies to code linked from these dependencies: [thiserror-impl](https://github.com/dtolnay/thiserror), [thiserror](https://github.com/dtolnay/thiserror), [thread_local](https://github.com/Amanieu/thread_local-rs), -[tinyvec](https://github.com/Lokathor/tinyvec), -[tinyvec_macros](https://github.com/Soveu/tinyvec_macros), [toml](https://github.com/alexcrichton/toml-rs), [typenum](https://github.com/paholg/typenum), -[unicode-normalization](https://github.com/unicode-rs/unicode-normalization), [url](https://github.com/servo/rust-url), [utf8_iter](https://github.com/hsivonen/utf8_iter), [uuid](https://github.com/uuid-rs/uuid), @@ -963,37 +959,6 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -``` -------------- -## MIT License: caseless - -The following text applies to code linked from these dependencies: -[caseless](https://github.com/SimonSapin/rust-caseless) - -``` -Copyright (c) 2017 Simon Sapin - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ``` ------------- ## MIT License: core_maths diff --git a/components/places/Cargo.toml b/components/places/Cargo.toml index f891c03175..c3df5fa3e7 100644 --- a/components/places/Cargo.toml +++ b/components/places/Cargo.toml @@ -20,7 +20,7 @@ parking_lot = "0.12" lazy_static = "1.4" url = { version = "2.1", features = ["serde"] } percent-encoding = "2.1" -caseless = "0.2" +icu_casemap = "2" rusqlite = { version = "0.37.0", features = ["functions", "window", "bundled", "unlock_notify"] } sql-support = { path = "../support/sql" } types = { path = "../support/types" } diff --git a/components/places/src/match_impl.rs b/components/places/src/match_impl.rs index ce06ab7b26..20e1b0ca83 100644 --- a/components/places/src/match_impl.rs +++ b/components/places/src/match_impl.rs @@ -4,7 +4,7 @@ use crate::util; use bitflags::bitflags; -use caseless::Caseless; +use icu_casemap::CaseMapperBorrowed; use rusqlite::{ self, types::{FromSql, FromSqlError, FromSqlResult, ToSql, ToSqlOutput, ValueRef}, @@ -13,6 +13,8 @@ use std::borrow::Cow; const MAX_CHARS_TO_SEARCH_THROUGH: usize = 255; +static CASE_MAPPER: CaseMapperBorrowed<'_> = CaseMapperBorrowed::new(); + #[derive(Clone, Copy, PartialEq, Eq, Debug)] #[repr(u32)] pub enum MatchBehavior { @@ -225,8 +227,10 @@ fn string_match(token: &str, source: &str) -> bool { if source.len() < token.len() { return false; } - let mut ti = token.chars().default_case_fold(); - let mut si = source.chars().default_case_fold(); + let t_folded = CASE_MAPPER.fold_string(token); + let mut ti = t_folded.chars(); + let s_folded = CASE_MAPPER.fold_string(source); + let mut si = s_folded.chars(); loop { match (ti.next(), si.next()) { (None, _) => return true, diff --git a/megazords/full/DEPENDENCIES.md b/megazords/full/DEPENDENCIES.md index 291eda63ca..d1ee7c4722 100644 --- a/megazords/full/DEPENDENCIES.md +++ b/megazords/full/DEPENDENCIES.md @@ -10,7 +10,6 @@ the details of which are reproduced below. * [MIT License: bincode](#mit-license-bincode) * [MIT License: bytes](#mit-license-bytes) * [MIT License: cargo_metadata, winnow](#mit-license-cargo_metadata-winnow) -* [MIT License: caseless](#mit-license-caseless) * [MIT License: core_maths](#mit-license-core_maths) * [MIT License: extend](#mit-license-extend) * [MIT License: generic-array](#mit-license-generic-array) @@ -532,11 +531,8 @@ The following text applies to code linked from these dependencies: [thiserror-impl](https://github.com/dtolnay/thiserror), [thiserror](https://github.com/dtolnay/thiserror), [thread_local](https://github.com/Amanieu/thread_local-rs), -[tinyvec](https://github.com/Lokathor/tinyvec), -[tinyvec_macros](https://github.com/Soveu/tinyvec_macros), [toml](https://github.com/alexcrichton/toml-rs), [typenum](https://github.com/paholg/typenum), -[unicode-normalization](https://github.com/unicode-rs/unicode-normalization), [url](https://github.com/servo/rust-url), [utf8_iter](https://github.com/hsivonen/utf8_iter), [uuid](https://github.com/uuid-rs/uuid), @@ -880,37 +876,6 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -``` -------------- -## MIT License: caseless - -The following text applies to code linked from these dependencies: -[caseless](https://github.com/SimonSapin/rust-caseless) - -``` -Copyright (c) 2017 Simon Sapin - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ``` ------------- ## MIT License: core_maths diff --git a/megazords/full/android/dependency-licenses.xml b/megazords/full/android/dependency-licenses.xml index 74a4ffaae1..8d7e33f639 100644 --- a/megazords/full/android/dependency-licenses.xml +++ b/megazords/full/android/dependency-licenses.xml @@ -456,14 +456,6 @@ the details of which are reproduced below. Apache License 2.0: thread_local https://github.com/Amanieu/thread_local-rs/blob/master/LICENSE-APACHE - - Apache License 2.0: tinyvec - https://github.com/Lokathor/tinyvec/blob/main/LICENSE-ZLIB.md - - - Apache License 2.0: tinyvec_macros - https://github.com/Soveu/tinyvec_macros/blob/master/LICENSE-APACHE.md - Apache License 2.0: toml https://github.com/alexcrichton/toml-rs/blob/master/LICENSE-APACHE @@ -472,10 +464,6 @@ the details of which are reproduced below. Apache License 2.0: typenum https://github.com/paholg/typenum/blob/main/LICENSE-APACHE - - Apache License 2.0: unicode-normalization - https://github.com/unicode-rs/unicode-normalization/blob/master/LICENSE-APACHE - Apache License 2.0: url https://github.com/servo/rust-url/blob/main/LICENSE-APACHE @@ -544,10 +532,6 @@ the details of which are reproduced below. MIT License: winnow https://github.com/winnow-rs/winnow/blob/main/LICENSE-MIT - - MIT License: caseless - https://github.com/SimonSapin/rust-caseless/blob/master/LICENSE - MIT License: core_maths https://github.com/robertbastian/core_maths/blob/main/LICENSE diff --git a/megazords/ios-rust/DEPENDENCIES.md b/megazords/ios-rust/DEPENDENCIES.md index 868dfb7bbb..06a089b0d6 100644 --- a/megazords/ios-rust/DEPENDENCIES.md +++ b/megazords/ios-rust/DEPENDENCIES.md @@ -11,7 +11,6 @@ the details of which are reproduced below. * [MIT License: bincode](#mit-license-bincode) * [MIT License: bytes](#mit-license-bytes) * [MIT License: cargo_metadata, winnow](#mit-license-cargo_metadata-winnow) -* [MIT License: caseless](#mit-license-caseless) * [MIT License: core_maths](#mit-license-core_maths) * [MIT License: extend](#mit-license-extend) * [MIT License: generic-array](#mit-license-generic-array) @@ -567,11 +566,8 @@ The following text applies to code linked from these dependencies: [thiserror-impl](https://github.com/dtolnay/thiserror), [thiserror](https://github.com/dtolnay/thiserror), [thread_local](https://github.com/Amanieu/thread_local-rs), -[tinyvec](https://github.com/Lokathor/tinyvec), -[tinyvec_macros](https://github.com/Soveu/tinyvec_macros), [toml](https://github.com/alexcrichton/toml-rs), [typenum](https://github.com/paholg/typenum), -[unicode-normalization](https://github.com/unicode-rs/unicode-normalization), [url](https://github.com/servo/rust-url), [utf8_iter](https://github.com/hsivonen/utf8_iter), [uuid](https://github.com/uuid-rs/uuid), @@ -941,37 +937,6 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -``` -------------- -## MIT License: caseless - -The following text applies to code linked from these dependencies: -[caseless](https://github.com/SimonSapin/rust-caseless) - -``` -Copyright (c) 2017 Simon Sapin - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ``` ------------- ## MIT License: core_maths