diff --git a/Cargo.toml b/Cargo.toml index 5f70445900df8..1435e1a1d243f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,7 +55,7 @@ hex = "0.4.3" indexmap = { version = "2", features = ["std"] } itoa = "1.0.6" itoap = { version = "1", features = ["simd"] } -kstring = { version = "2.0.2", features = ["arc", "max_inline", "serde"] } +kstring = { version = "2.0.2", features = ["serde"] } libc = "0.2" memchr = "2.6" memmap = { package = "memmap2", version = "0.7" } diff --git a/crates/polars-utils/src/pl_str.rs b/crates/polars-utils/src/pl_str.rs index 62a8903e5d86a..29ab9ff73b67a 100644 --- a/crates/polars-utils/src/pl_str.rs +++ b/crates/polars-utils/src/pl_str.rs @@ -1,5 +1,3 @@ -use kstring::KString; - #[macro_export] macro_rules! format_pl_smallstr { ($($arg:tt)*) => {{ @@ -11,29 +9,31 @@ macro_rules! format_pl_smallstr { }} } +type Inner = kstring::KStringBase; + /// String type that interns small strings and has O(1) clone. #[derive(Clone, Eq, Hash, PartialOrd, Ord)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -pub struct PlSmallStr(kstring::KStringBase); +pub struct PlSmallStr(Inner); impl PlSmallStr { - pub const EMPTY: Self = Self(KString::EMPTY); - pub const EMPTY_REF: &'static Self = &Self(KString::EMPTY); + pub const EMPTY: Self = Self(Inner::EMPTY); + pub const EMPTY_REF: &'static Self = &Self(Inner::EMPTY); #[inline(always)] pub const fn from_static(s: &'static str) -> Self { - Self(KString::from_static(s)) + Self(Inner::from_static(s)) } #[inline(always)] #[allow(clippy::should_implement_trait)] pub fn from_str(s: &str) -> Self { - Self(KString::from_ref(s)) + Self(Inner::from_ref(s)) } #[inline(always)] pub fn from_string(s: String) -> Self { - Self(KString::from_string(s)) + Self(Inner::from_string(s)) } #[inline(always)]