diff --git a/Cargo.lock b/Cargo.lock index 7d14eb7..e4f265d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "case_insensitive_string" -version = "0.1.7" +version = "0.2.0" dependencies = [ "compact_str", "serde", @@ -27,9 +27,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "compact_str" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff0805f79ecb1b35163f3957a6934ea8d04fcd36ef98b52e7316f63e72e73d1" +checksum = "f86b9c4c00838774a6d902ef931eff7470720c51d90c2e32cfe15dc304737b3f" dependencies = [ "castaway", "cfg-if", @@ -46,18 +46,18 @@ checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "75cb1540fadbd5b8fbccc4dddad2734eba435053f725621c070711a14bb5f4b8" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.27" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -76,18 +76,18 @@ checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" [[package]] name = "serde" -version = "1.0.163" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.163" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", @@ -102,9 +102,9 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "syn" -version = "2.0.15" +version = "2.0.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" +checksum = "5b7d0a2c048d661a1a59fcd7355baa232f7ed34e0ee4df2eef3c1c1c0d3852d8" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index d086f12..7e01b28 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "case_insensitive_string" -version = "0.1.7" +version = "0.2.0" authors = ["Jeff Mendez "] edition = "2021" description = "A case insensitive string struct." @@ -12,8 +12,9 @@ categories = ["config", "data-structures"] include = ["src/*", "LICENSE", "README.md"] [dependencies] -compact_str = { version = "0.7.0", optional = true } -serde = { version = "^1.0.155", optional = true, features = ["derive"] } +compact_str = { version = "0.7.1", optional = true } +serde = { version = "^1.0.193", optional = true, features = ["derive"] } [features] -compact = [ "compact_str", "serde" ] +compact = ["dep:compact_str"] +serde = ["dep:serde"] diff --git a/src/lib.rs b/src/lib.rs index a3eeabf..35ac81e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -41,6 +41,14 @@ impl From<&str> for CaseInsensitiveString { } } +#[cfg(feature = "compact")] +impl From for CaseInsensitiveString { + #[inline] + fn from(s: compact_str::CompactString) -> Self { + CaseInsensitiveString { 0: s.into() } + } +} + impl From for CaseInsensitiveString { fn from(s: String) -> Self { CaseInsensitiveString { 0: s.into() }