refactor to use common result type

This commit is contained in:
Vukašin Stepanović
2023-02-14 22:56:03 +00:00
parent 145cf704fe
commit 8ee616d96b
160 changed files with 829 additions and 901 deletions

View File

@@ -18,6 +18,7 @@
use std::cmp;
use crate::common::Result;
use crate::Exceptions;
/**
@@ -68,7 +69,7 @@ impl BitSource {
* bits of the int
* @throws IllegalArgumentException if numBits isn't in [1,32] or more than is available
*/
pub fn readBits(&mut self, numBits: usize) -> Result<u32, Exceptions> {
pub fn readBits(&mut self, numBits: usize) -> Result<u32> {
if !(1..=32).contains(&numBits) || numBits > self.available() {
return Err(Exceptions::IllegalArgumentException(Some(
numBits.to_string(),