Skip to content

Commit 7542eaa

Browse files
committed
Make exported trait public
1 parent 7f3f0e5 commit 7542eaa

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/cryptoutil.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,7 @@ pub fn symm_enc_or_dec<S: SynchronousStreamCipher, R: ReadBuffer, W: WriteBuffer
243243
}
244244
}
245245

246-
247-
trait ToBits {
246+
pub trait ToBits {
248247
/// Convert the value in bytes to the number of bits, a tuple where the 1st item is the
249248
/// high-order value and the 2nd item is the low order value.
250249
fn to_bits(self) -> (Self, Self);
@@ -265,10 +264,7 @@ pub fn add_bytes_to_bits<T: Int + ToBits>(bits: T, bytes: T) -> T {
265264
panic!("Numeric overflow occured.")
266265
}
267266

268-
match bits.checked_add(new_low_bits) {
269-
Some(x) => return x,
270-
None => panic!("Numeric overflow occured.")
271-
}
267+
bits.checked_add(new_low_bits).expect("Numeric overflow occured.")
272268
}
273269

274270
/// Adds the specified number of bytes to the bit count, which is a tuple where the first element is

0 commit comments

Comments
 (0)