From bf2a2c18aa024f72b32235e7921aaf4da8a5eb9d Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Tue, 29 Aug 2023 10:18:00 -0400 Subject: [PATCH] deps: upgrade to memchr 2.6 We can now utilize its `alloc` feature. And in particular, make the `Finder::into_owned` API available only when `alloc` is enabled. We don't need `std` for it, but did previously because `memchr` didn't expose an `alloc` feature. --- Cargo.toml | 4 ++-- src/ext_slice.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c4a7e5c..b4f5a49 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,12 +24,12 @@ bench = false [features] default = ["std", "unicode"] std = ["alloc", "memchr/std", "serde?/std"] -alloc = ["serde?/alloc"] +alloc = ["memchr/alloc", "serde?/alloc"] unicode = ["dep:regex-automata"] serde = ["dep:serde"] [dependencies] -memchr = { version = "2.4.0", default-features = false } +memchr = { version = "2.6.1", default-features = false } serde = { version = "1.0.85", default-features = false, optional = true } [dependencies.regex-automata] diff --git a/src/ext_slice.rs b/src/ext_slice.rs index 5e18019..503e0b2 100644 --- a/src/ext_slice.rs +++ b/src/ext_slice.rs @@ -3106,8 +3106,8 @@ impl<'a> Finder<'a> { /// If this is already an owned finder, then this is a no-op. Otherwise, /// this copies the needle. /// - /// This is only available when the `std` feature is enabled. - #[cfg(feature = "std")] + /// This is only available when the `alloc` feature is enabled. + #[cfg(feature = "alloc")] #[inline] pub fn into_owned(self) -> Finder<'static> { Finder(self.0.into_owned()) @@ -3189,8 +3189,8 @@ impl<'a> FinderReverse<'a> { /// If this is already an owned finder, then this is a no-op. Otherwise, /// this copies the needle. /// - /// This is only available when the `std` feature is enabled. - #[cfg(feature = "std")] + /// This is only available when the `alloc` feature is enabled. + #[cfg(feature = "alloc")] #[inline] pub fn into_owned(self) -> FinderReverse<'static> { FinderReverse(self.0.into_owned())