Skip to content

Commit

Permalink
Add in from_radix for API consistency.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexhuszagh committed Jan 11, 2025
1 parent 35a222d commit 6a48439
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lexical-parse-integer/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,13 @@ impl Options {
Self::builder().build_unchecked()
}

/// Create the default options for a given radix.
#[inline(always)]
#[cfg(feature = "power-of-two")]
pub const fn from_radix(_: u8) -> Self {
Self::new()
}

// GETTERS

/// Check if the builder state is valid (always [`true`]).
Expand Down
7 changes: 7 additions & 0 deletions lexical-write-integer/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ impl Options {
Self {}
}

/// Create the default options for a given radix.
#[inline(always)]
#[cfg(feature = "power-of-two")]
pub const fn from_radix(_: u8) -> Self {
Self::new()
}

/// Check if the options state is valid.
#[inline(always)]
pub const fn is_valid(&self) -> bool {
Expand Down

0 comments on commit 6a48439

Please sign in to comment.