make push_number_checked public to handle structured append

This commit is contained in:
Riccardo Casatta 2020-04-04 18:19:34 +02:00
parent 59a30b9d12
commit 43d9499cff

View file

@ -63,7 +63,7 @@ impl Bits {
/// that the number does not overflow the bits.
///
/// Returns `Err(QrError::DataTooLong)` on overflow.
fn push_number_checked(&mut self, n: usize, number: usize) -> QrResult<()> {
pub fn push_number_checked(&mut self, n: usize, number: usize) -> QrResult<()> {
if n > 16 || number >= (1 << n) {
Err(QrError::DataTooLong)
} else {