diff options
Diffstat (limited to 'vendor/tinystr')
-rw-r--r-- | vendor/tinystr/.cargo-checksum.json | 2 | ||||
-rw-r--r-- | vendor/tinystr/Cargo.toml | 14 | ||||
-rw-r--r-- | vendor/tinystr/README.md | 6 | ||||
-rw-r--r-- | vendor/tinystr/src/ascii.rs | 17 | ||||
-rw-r--r-- | vendor/tinystr/src/error.rs | 3 | ||||
-rw-r--r-- | vendor/tinystr/src/lib.rs | 8 |
6 files changed, 27 insertions, 23 deletions
diff --git a/vendor/tinystr/.cargo-checksum.json b/vendor/tinystr/.cargo-checksum.json index 36b7cede5..86027edd3 100644 --- a/vendor/tinystr/.cargo-checksum.json +++ b/vendor/tinystr/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"279fef44ae26d0bda43cc629cbe22795d696b36635fcb7ca484e74b9d72b9eb4","LICENSE":"4ad7541d66a407234e2c84902124cef325c29f3e966353efdb800bedb8b8da21","README.md":"ce7d4b009ab4878b4b647fa5c01037b4d3e8bf72e44942dbf6cf1ef217d10b4d","benches/common/mod.rs":"7a31f89cb68cec2574287636ac22fe3fc86a66688b8b1e99700a5da692bd485e","benches/construct.rs":"0e0e7c1459dd3efea0c734a999318078b53e18c3389c74a1ff5a226cd3d05cca","benches/overview.rs":"296d19b32a2d52e449140771d89f9c099d19177eb84e1395c942469d51c4c3f8","benches/read.rs":"cbf349393a50eb90e7ba53906f98a689d585242292f867a37acf6842263af4d9","benches/serde.rs":"5c88866d08c07088b82dbd5472e6276c632d11e064417f5d8f2025a5ade867f0","src/ascii.rs":"ca84603237893d515cf4d3cc5bf61470a81c499956b8bdf51239433c0d49785e","src/asciibyte.rs":"fa29de7403c0424c52c2f30bb47002b9abf4bd08b302c411ffe679d3decfb8de","src/databake.rs":"9f29e30e6deec989822cbdf01f5165e098fa544cf7e49ccea3f5de827648fc1e","src/error.rs":"859d03faa3e98d979e0d6b5d232810d42b58f9c6ef69403d442545327053265e","src/int_ops.rs":"c2be314d19dd41cf18fb3589901d7e58ee32fe3f764fb6a66b08a1e005336406","src/lib.rs":"41db27f31650945dbf41b72a21d42fa4de0722b6f0717a45a3569c3dd4f1e148","src/macros.rs":"3fe76e258b0db2896284bcf4f50a4ac35b7efc542649b4c9f13c6e71c5957ae4","src/serde.rs":"0bd6bbe2ee8195aea68dd235d59b94faa3419aaeb8939e3220dd64bd888873f5","src/ule.rs":"139543634949a95405bc49862840b0794db089abed6efe66533858376cae180f","tests/serde.rs":"cf8cee82f731928375888d1b5e7e5e50368d3e16ce372fced230c9b1ee2a7451"},"package":"f8aeafdfd935e4a7fe16a91ab711fa52d54df84f9c8f7ca5837a9d1d902ef4c2"}
\ No newline at end of file +{"files":{"Cargo.toml":"b28bb188b7c3b68f9d9a710921a42f337bd2e07eb7588d983b20724f64d6a8c8","LICENSE":"4ad7541d66a407234e2c84902124cef325c29f3e966353efdb800bedb8b8da21","README.md":"8e79e986c696d6010a578b2872ee4144d86e26d30a409167ff2cf2af551ef231","benches/common/mod.rs":"7a31f89cb68cec2574287636ac22fe3fc86a66688b8b1e99700a5da692bd485e","benches/construct.rs":"0e0e7c1459dd3efea0c734a999318078b53e18c3389c74a1ff5a226cd3d05cca","benches/overview.rs":"296d19b32a2d52e449140771d89f9c099d19177eb84e1395c942469d51c4c3f8","benches/read.rs":"cbf349393a50eb90e7ba53906f98a689d585242292f867a37acf6842263af4d9","benches/serde.rs":"5c88866d08c07088b82dbd5472e6276c632d11e064417f5d8f2025a5ade867f0","src/ascii.rs":"403408b47d813110e840d4db688145c37a17fbcbff173038d9e3743aa712b321","src/asciibyte.rs":"fa29de7403c0424c52c2f30bb47002b9abf4bd08b302c411ffe679d3decfb8de","src/databake.rs":"9f29e30e6deec989822cbdf01f5165e098fa544cf7e49ccea3f5de827648fc1e","src/error.rs":"e0cbc912258d6e56aad148404d7cc3213d89736fa9ebe56c41f6cb0df7b2dd63","src/int_ops.rs":"c2be314d19dd41cf18fb3589901d7e58ee32fe3f764fb6a66b08a1e005336406","src/lib.rs":"7ddbd83bcb9091495de3c4a7eb7ecc25313c54991be8b463d67a7c2e97c076b6","src/macros.rs":"3fe76e258b0db2896284bcf4f50a4ac35b7efc542649b4c9f13c6e71c5957ae4","src/serde.rs":"0bd6bbe2ee8195aea68dd235d59b94faa3419aaeb8939e3220dd64bd888873f5","src/ule.rs":"139543634949a95405bc49862840b0794db089abed6efe66533858376cae180f","tests/serde.rs":"cf8cee82f731928375888d1b5e7e5e50368d3e16ce372fced230c9b1ee2a7451"},"package":"7ac3f5b6856e931e15e07b478e98c8045239829a65f9156d4fa7e7788197a5ef"}
\ No newline at end of file diff --git a/vendor/tinystr/Cargo.toml b/vendor/tinystr/Cargo.toml index 64682f74e..284ce6d2d 100644 --- a/vendor/tinystr/Cargo.toml +++ b/vendor/tinystr/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2021" name = "tinystr" -version = "0.7.0" +version = "0.7.1" authors = ["The ICU4X Project Developers"] include = [ "src/**/*", @@ -36,9 +36,15 @@ license = "Unicode-DFS-2016" repository = "https://github.com/unicode-org/icu4x" resolver = "2" +[package.metadata.workspaces] +independent = true + [package.metadata.docs.rs] all-features = true +[package.metadata.cargo-all-features] +denylist = ["bench"] + [[test]] name = "serde" required-features = ["serde"] @@ -66,7 +72,7 @@ required-features = [ ] [dependencies.databake] -version = "0.1" +version = "0.1.3" optional = true [dependencies.displaydoc] @@ -80,7 +86,7 @@ optional = true default-features = false [dependencies.zerovec] -version = "0.9" +version = "0.9.2" optional = true [dev-dependencies.bincode] @@ -111,4 +117,4 @@ package = "tinystr" alloc = [] bench = [] default = ["alloc"] -zerovec = ["dep:zerovec"] +std = [] diff --git a/vendor/tinystr/README.md b/vendor/tinystr/README.md index 96b3f955f..5f9a8142b 100644 --- a/vendor/tinystr/README.md +++ b/vendor/tinystr/README.md @@ -19,8 +19,8 @@ assert_eq!(s1, "tEsT"); assert_eq!(s1.to_ascii_uppercase(), "TEST"); assert_eq!(s1.to_ascii_lowercase(), "test"); assert_eq!(s1.to_ascii_titlecase(), "Test"); -assert_eq!(s1.is_ascii_alphanumeric(), true); -assert_eq!(s1.is_ascii_numeric(), false); +assert!(s1.is_ascii_alphanumeric()); +assert!(!s1.is_ascii_numeric()); let s2 = TinyAsciiStr::<8>::try_from_raw(*b"New York") .expect("Failed to parse."); @@ -29,7 +29,7 @@ assert_eq!(s2, "New York"); assert_eq!(s2.to_ascii_uppercase(), "NEW YORK"); assert_eq!(s2.to_ascii_lowercase(), "new york"); assert_eq!(s2.to_ascii_titlecase(), "New york"); -assert_eq!(s2.is_ascii_alphanumeric(), false); +assert!(!s2.is_ascii_alphanumeric()); ``` ## Details diff --git a/vendor/tinystr/src/ascii.rs b/vendor/tinystr/src/ascii.rs index 0be1125e3..f39f39b73 100644 --- a/vendor/tinystr/src/ascii.rs +++ b/vendor/tinystr/src/ascii.rs @@ -138,11 +138,6 @@ impl<const N: usize> TinyAsciiStr<N> { #[inline] #[must_use] pub const fn as_bytes(&self) -> &[u8] { - /// core::slice::from_raw_parts(a, b) = core::mem::transmute((a, b)) hack - /// ```compile_fail - /// const unsafe fn canary() { core::slice::from_raw_parts(0 as *const u8, 0); } - /// ``` - const _: () = (); // Safe because `self.bytes.as_slice()` pointer-casts to `&[u8]`, // and changing the length of that slice to self.len() < N is safe. unsafe { core::mem::transmute((self.bytes.as_slice().as_ptr(), self.len())) } @@ -668,7 +663,7 @@ mod test { use rand::seq::SliceRandom; use rand::SeedableRng; - const STRINGS: &[&str] = &[ + const STRINGS: [&str; 26] = [ "Latn", "laTn", "windows", @@ -723,8 +718,8 @@ mod test { T: core::fmt::Debug + core::cmp::PartialEq, { for s in STRINGS - .iter() - .map(|s| s.to_string()) + .into_iter() + .map(str::to_owned) .chain(gen_strings(100, &[3, 4, 5, 8, 12])) { let t = match TinyAsciiStr::<N>::from_str(&s) { @@ -930,7 +925,7 @@ mod test { .map(|c| c.to_ascii_lowercase()) .collect::<String>() }, - |t: TinyAsciiStr<N>| TinyAsciiStr::to_ascii_lowercase(t).to_string(), + |t: TinyAsciiStr<N>| TinyAsciiStr::to_ascii_lowercase(t).as_str().to_owned(), ) } check::<2>(); @@ -954,7 +949,7 @@ mod test { unsafe { r.as_bytes_mut()[0].make_ascii_uppercase() }; r }, - |t: TinyAsciiStr<N>| TinyAsciiStr::to_ascii_titlecase(t).to_string(), + |t: TinyAsciiStr<N>| TinyAsciiStr::to_ascii_titlecase(t).as_str().to_owned(), ) } check::<2>(); @@ -974,7 +969,7 @@ mod test { .map(|c| c.to_ascii_uppercase()) .collect::<String>() }, - |t: TinyAsciiStr<N>| TinyAsciiStr::to_ascii_uppercase(t).to_string(), + |t: TinyAsciiStr<N>| TinyAsciiStr::to_ascii_uppercase(t).as_str().to_owned(), ) } check::<2>(); diff --git a/vendor/tinystr/src/error.rs b/vendor/tinystr/src/error.rs index 03901431c..7910f8b48 100644 --- a/vendor/tinystr/src/error.rs +++ b/vendor/tinystr/src/error.rs @@ -4,6 +4,9 @@ use displaydoc::Display; +#[cfg(feature = "std")] +impl std::error::Error for TinyStrError {} + #[derive(Display, Debug, PartialEq, Eq)] #[non_exhaustive] pub enum TinyStrError { diff --git a/vendor/tinystr/src/lib.rs b/vendor/tinystr/src/lib.rs index 96018b8b2..7745da0e5 100644 --- a/vendor/tinystr/src/lib.rs +++ b/vendor/tinystr/src/lib.rs @@ -21,8 +21,8 @@ //! assert_eq!(s1.to_ascii_uppercase(), "TEST"); //! assert_eq!(s1.to_ascii_lowercase(), "test"); //! assert_eq!(s1.to_ascii_titlecase(), "Test"); -//! assert_eq!(s1.is_ascii_alphanumeric(), true); -//! assert_eq!(s1.is_ascii_numeric(), false); +//! assert!(s1.is_ascii_alphanumeric()); +//! assert!(!s1.is_ascii_numeric()); //! //! let s2 = TinyAsciiStr::<8>::try_from_raw(*b"New York") //! .expect("Failed to parse."); @@ -31,7 +31,7 @@ //! assert_eq!(s2.to_ascii_uppercase(), "NEW YORK"); //! assert_eq!(s2.to_ascii_lowercase(), "new york"); //! assert_eq!(s2.to_ascii_titlecase(), "New york"); -//! assert_eq!(s2.is_ascii_alphanumeric(), false); +//! assert!(!s2.is_ascii_alphanumeric()); //! ``` //! //! # Details @@ -52,7 +52,7 @@ //! [`ICU4X`]: ../icu/index.html // https://github.com/unicode-org/icu4x/blob/main/docs/process/boilerplate.md#library-annotations -#![cfg_attr(not(test), no_std)] +#![cfg_attr(not(any(test, feature = "std")), no_std)] #![cfg_attr( not(test), deny( |