Skip to content

Commit

Permalink
Add const to new_unchecked()
Browse files Browse the repository at this point in the history
Signed-off-by: CuriouslyCurious <thecuriouslycurious@protonmail.com>
  • Loading branch information
CuriouslyCurious committed Aug 2, 2023
1 parent a2e07d3 commit 0fce06a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ impl<F: Flags> FlagSet<F> {
/// }
///
/// // Unknown and invalid bits are retained. Behavior is undefined.
/// let set = unsafe { FlagSet::<Flag>::new_unchecked(0b11101) };
/// const set: FlagSet<Flag> = unsafe { FlagSet::<Flag>::new_unchecked(0b11101) };
/// assert_eq!(set.bits(), 0b11101);
/// ```
///
Expand All @@ -849,7 +849,7 @@ impl<F: Flags> FlagSet<F> {
/// This constructor doesn't check that the bits are valid. If you pass
/// undefined flags, undefined behavior may result.
#[inline]
pub unsafe fn new_unchecked(bits: F::Type) -> Self {
pub const unsafe fn new_unchecked(bits: F::Type) -> Self {
FlagSet(bits)
}

Expand Down

0 comments on commit 0fce06a

Please sign in to comment.