Skip to content

Commit

Permalink
deps: upgrade to memchr 2.6
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
BurntSushi committed Aug 29, 2023
1 parent 8d0afbc commit bf2a2c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
8 changes: 4 additions & 4 deletions src/ext_slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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())
Expand Down

0 comments on commit bf2a2c1

Please sign in to comment.