From 44b05f6314382550db4020a857e7b7f523a740fb Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 29 Aug 2024 19:47:11 -0700 Subject: [PATCH] add digits_mut to buint --- src/buint/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/buint/mod.rs b/src/buint/mod.rs index 3d00417..cdfdecf 100644 --- a/src/buint/mod.rs +++ b/src/buint/mod.rs @@ -484,6 +484,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)]