rename helper methods

This commit is contained in:
Vukašin Stepanović
2023-02-15 12:52:59 +00:00
parent bfcdb397ad
commit 935519ced5
133 changed files with 858 additions and 1044 deletions

View File

@@ -199,7 +199,7 @@ impl<'a> GeneralAppIdDecoder<'_> {
if let Some(r) = result.getDecodedInformation() {
Ok(r.clone())
} else {
Err(Exceptions::notFoundEmpty())
Err(Exceptions::notFound)
}
}
@@ -345,7 +345,7 @@ impl<'a> GeneralAppIdDecoder<'_> {
if (5..15).contains(&fiveBitValue) {
return Ok(DecodedChar::new(
pos + 5,
char::from_u32('0' as u32 + fiveBitValue - 5).ok_or(Exceptions::parseEmpty())?,
char::from_u32('0' as u32 + fiveBitValue - 5).ok_or(Exceptions::parse)?,
));
}
@@ -354,14 +354,14 @@ impl<'a> GeneralAppIdDecoder<'_> {
if (64..90).contains(&sevenBitValue) {
return Ok(DecodedChar::new(
pos + 7,
char::from_u32(sevenBitValue + 1).ok_or(Exceptions::parseEmpty())?,
char::from_u32(sevenBitValue + 1).ok_or(Exceptions::parse)?,
));
}
if (90..116).contains(&sevenBitValue) {
return Ok(DecodedChar::new(
pos + 7,
char::from_u32(sevenBitValue + 7).ok_or(Exceptions::parseEmpty())?,
char::from_u32(sevenBitValue + 7).ok_or(Exceptions::parse)?,
));
}
@@ -388,7 +388,7 @@ impl<'a> GeneralAppIdDecoder<'_> {
250 => '?',
251 => '_',
252 => ' ',
_ => return Err(Exceptions::formatEmpty()),
_ => return Err(Exceptions::format),
};
Ok(DecodedChar::new(pos + 8, c))
@@ -423,7 +423,7 @@ impl<'a> GeneralAppIdDecoder<'_> {
if (5..15).contains(&fiveBitValue) {
return Ok(DecodedChar::new(
pos + 5,
char::from_u32('0' as u32 + fiveBitValue - 5).ok_or(Exceptions::parseEmpty())?,
char::from_u32('0' as u32 + fiveBitValue - 5).ok_or(Exceptions::parse)?,
));
}
@@ -432,7 +432,7 @@ impl<'a> GeneralAppIdDecoder<'_> {
if (32..58).contains(&sixBitValue) {
return Ok(DecodedChar::new(
pos + 6,
char::from_u32(sixBitValue + 33).ok_or(Exceptions::parseEmpty())?,
char::from_u32(sixBitValue + 33).ok_or(Exceptions::parse)?,
));
}
@@ -443,7 +443,7 @@ impl<'a> GeneralAppIdDecoder<'_> {
61 => '.',
62 => '/',
_ => {
return Err(Exceptions::illegalState(format!(
return Err(Exceptions::illegalStateWith(format!(
"Decoding invalid alphanumeric value: {sixBitValue}"
)))
}