Skip to content

Commit

Permalink
Merge pull request #45 from krakow10/digits-mut
Browse files Browse the repository at this point in the history
add digits_mut to buint
  • Loading branch information
isaacholt100 authored Sep 4, 2024
2 parents 8c06221 + 44b05f6 commit 6b5dd7f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/buint/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,13 @@ macro_rules! mod_impl {
&self.digits
}

/// Returns the digits stored in `self` as a mutable array. Digits are little endian (least significant digit first).
#[must_use]
#[inline(always)]
pub fn digits_mut(&mut self) -> &mut [$Digit; N] {
&mut self.digits
}

/// Creates a new unsigned integer from the given array of digits. Digits are stored as little endian (least significant digit first).
#[must_use]
#[inline(always)]
Expand Down

0 comments on commit 6b5dd7f

Please sign in to comment.