| Index: mojo/public/rust/src/bindings/encoding.rs
|
| diff --git a/mojo/public/rust/src/bindings/encoding.rs b/mojo/public/rust/src/bindings/encoding.rs
|
| index 1cb3a91c297d2e6604f1d469352286f66a2b6870..41d9c8ad1983371902ceea4e3c3e58c7743d7f5c 100644
|
| --- a/mojo/public/rust/src/bindings/encoding.rs
|
| +++ b/mojo/public/rust/src/bindings/encoding.rs
|
| @@ -41,6 +41,13 @@ impl Bits {
|
| 1 << (self.0 & 7)
|
| }
|
|
|
| + pub fn checked_mul(self, val: usize) -> Option<Bits> {
|
| + match val.checked_mul(self.0) {
|
| + Some(result) => Some(Bits(result)),
|
| + None => None,
|
| + }
|
| + }
|
| +
|
| /// Align the bits to some number of bytes.
|
| pub fn align_to_bytes(&mut self, bytes: usize) {
|
| self.0 = util::align_bytes(self.0, 8 * bytes);
|
|
|