Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,14 @@ macro_rules! implement_common {
$name(value)
}

/// Creates a new instance without checking if the value is representable by this type.
///
/// # Safety
/// The value must be representable by this type.
pub const unsafe fn new_unchecked(value: $type) -> $name {
$name(value)
}

/// Wrapping (modular) subtraction. Computes `self - other`,
/// wrapping around at the boundary of the type.
///
Expand Down