Skip to content

Commit 29b67dc

Browse files
committed
Merge pull request #276 from marcusklaas/rustup
Make exported trait public
2 parents 7f3f0e5 + 9da1b1d commit 29b67dc

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rust-crypto"
3-
version = "0.2.24"
3+
version = "0.2.25"
44
authors = ["The Rust-Crypto Project Developers"]
55
license = "MIT/Apache-2.0"
66
homepage = "https://github.com/DaGenix/rust-crypto/"

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)