Skip to content

Commit

Permalink
api: gate 'into_owned' on 'alloc' feature
Browse files Browse the repository at this point in the history
We did this for the forward case but apparently didn't follow through
for the reverse case.

We also simplify the endianness diagnostic test.
  • Loading branch information
BurntSushi committed Aug 29, 2023
1 parent 9481f16 commit fb76eb3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/memmem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ impl<'h, 'n> FindRevIter<'h, 'n> {
/// this copies the needle.
///
/// This is only available when the `std` feature is enabled.
#[cfg(feature = "std")]
#[cfg(feature = "alloc")]
#[inline]
pub fn into_owned(self) -> FindRevIter<'h, 'static> {
FindRevIter {
Expand Down Expand Up @@ -606,7 +606,7 @@ impl<'n> FinderRev<'n> {
/// this copies the needle.
///
/// This is only available when the `std` feature is enabled.
#[cfg(feature = "std")]
#[cfg(feature = "alloc")]
#[inline]
pub fn into_owned(self) -> FinderRev<'static> {
FinderRev {
Expand Down
8 changes: 2 additions & 6 deletions src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@ pub(crate) mod substring;

// For debugging, particularly in CI, print out the byte order of the current
// target.
#[cfg(all(feature = "std", target_endian = "little"))]
#[test]
fn byte_order() {
#[cfg(target_endian = "little")]
std::eprintln!("LITTLE ENDIAN");
}

#[cfg(all(feature = "std", target_endian = "big"))]
#[test]
fn byte_order() {
#[cfg(target_endian = "big")]
std::eprintln!("BIG ENDIAN");
}

0 comments on commit fb76eb3

Please sign in to comment.