Skip to content

Commit

Permalink
use_std -> std
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvr committed Mar 5, 2025
1 parent d743e25 commit 8c1ea3e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ categories = ["data-structures", "no-std"]
serde = { version = "1.0", optional = true, default-features = false, features = ["alloc", "derive"] }

[features]
default = ["use_std"]
use_std = []
std = ["use_std"]
default = ["std"]
std = []
use_std = ["std"] # deprecated alias

[dev-dependencies]
serde_json = "1.0.0"
Expand Down
36 changes: 18 additions & 18 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//!
//! **Crate features:**
//!
//! * `"use_std"`
//! * `"std"`
//! Enabled by default. Disable to make the library `#![no_std]`.
//!
//! * `"serde"`
Expand All @@ -15,7 +15,7 @@
#![doc(html_root_url = "https://docs.rs/either/1/")]
#![no_std]

#[cfg(any(test, feature = "use_std"))]
#[cfg(any(test, feature = "std"))]
extern crate std;

#[cfg(feature = "serde")]
Expand All @@ -31,9 +31,9 @@ use core::ops::Deref;
use core::ops::DerefMut;
use core::pin::Pin;

#[cfg(any(test, feature = "use_std"))]
#[cfg(any(test, feature = "std"))]
use std::error::Error;
#[cfg(any(test, feature = "use_std"))]
#[cfg(any(test, feature = "std"))]
use std::io::{self, BufRead, Read, Seek, SeekFrom, Write};

pub use crate::Either::{Left, Right};
Expand Down Expand Up @@ -1154,10 +1154,10 @@ where
}
}

#[cfg(any(test, feature = "use_std"))]
#[cfg(any(test, feature = "std"))]
/// `Either<L, R>` implements `Read` if both `L` and `R` do.
///
/// Requires crate feature `"use_std"`
/// Requires crate feature `"std"`
impl<L, R> Read for Either<L, R>
where
L: Read,
Expand All @@ -1180,10 +1180,10 @@ where
}
}

#[cfg(any(test, feature = "use_std"))]
#[cfg(any(test, feature = "std"))]
/// `Either<L, R>` implements `Seek` if both `L` and `R` do.
///
/// Requires crate feature `"use_std"`
/// Requires crate feature `"std"`
impl<L, R> Seek for Either<L, R>
where
L: Seek,
Expand All @@ -1194,8 +1194,8 @@ where
}
}

#[cfg(any(test, feature = "use_std"))]
/// Requires crate feature `"use_std"`
#[cfg(any(test, feature = "std"))]
/// Requires crate feature `"std"`
impl<L, R> BufRead for Either<L, R>
where
L: BufRead,
Expand All @@ -1218,10 +1218,10 @@ where
}
}

#[cfg(any(test, feature = "use_std"))]
#[cfg(any(test, feature = "std"))]
/// `Either<L, R>` implements `Write` if both `L` and `R` do.
///
/// Requires crate feature `"use_std"`
/// Requires crate feature `"std"`
impl<L, R> Write for Either<L, R>
where
L: Write,
Expand Down Expand Up @@ -1279,17 +1279,17 @@ macro_rules! impl_specific_ref_and_mut {
impl_specific_ref_and_mut!(str,);
impl_specific_ref_and_mut!(
::std::path::Path,
cfg(feature = "use_std"),
cfg(feature = "std"),
doc = "Requires crate feature `use_std`."
);
impl_specific_ref_and_mut!(
::std::ffi::OsStr,
cfg(feature = "use_std"),
cfg(feature = "std"),
doc = "Requires crate feature `use_std`."
);
impl_specific_ref_and_mut!(
::std::ffi::CStr,
cfg(feature = "use_std"),
cfg(feature = "std"),
doc = "Requires crate feature `use_std`."
);

Expand Down Expand Up @@ -1345,10 +1345,10 @@ where
}
}

#[cfg(any(test, feature = "use_std"))]
#[cfg(any(test, feature = "std"))]
/// `Either` implements `Error` if *both* `L` and `R` implement it.
///
/// Requires crate feature `"use_std"`
/// Requires crate feature `"std"`
impl<L, R> Error for Either<L, R>
where
L: Error,
Expand Down Expand Up @@ -1553,7 +1553,7 @@ fn _unsized_ref_propagation() {
}

// This "unused" method is here to ensure that compilation doesn't fail on given types.
#[cfg(feature = "use_std")]
#[cfg(feature = "std")]
fn _unsized_std_propagation() {
check_t!(::std::path::Path);
check_t!(::std::ffi::OsStr);
Expand Down

0 comments on commit 8c1ea3e

Please sign in to comment.