Skip to content

Commit d1603ab

Browse files
authored
ctutils: remove Choice::new (#1314)
It had weird semantics: panicking in debug mode if given a `u8` other than `0` or `1`. Instead `Choice::from_u8_lsb` provides an equivalent constructor which never panicks or incorrectly initializes a `Choice`.
1 parent ae7a276 commit d1603ab

3 files changed

Lines changed: 2 additions & 9 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ctutils/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Constant-time utility library with selection and equality testing support target
55
applications. Supports `const fn` where appropriate. Built on the `cmov` crate which provides
66
architecture-specific predication intrinsics. Heavily inspired by the `subtle` crate.
77
"""
8-
version = "0.2.3"
8+
version = "0.3.0-pre"
99
authors = ["RustCrypto Developers"]
1010
license = "Apache-2.0 OR MIT"
1111
homepage = "https://github.com/RustCrypto/utils/tree/master/ctselect"

ctutils/src/choice.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,6 @@ impl Choice {
4545
/// Equivalent of [`true`].
4646
pub const TRUE: Self = Self(1);
4747

48-
/// DEPRECATED: legacy alias for [`Choice::from_u8_lsb`].
49-
#[deprecated(since = "0.2.3", note = "use `Choice::from_u8_lsb` instead")]
50-
#[inline]
51-
pub const fn new(value: u8) -> Self {
52-
Self::from_u8_lsb(value)
53-
}
54-
5548
/// Convert `Choice` into a `bool`.
5649
///
5750
/// <div class = "warning">

0 commit comments

Comments
 (0)