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

@@ -101,14 +101,14 @@ impl Version {
dimension: u32,
) -> Result<&'static Version, Exceptions> {
if dimension % 4 != 1 {
return Err(Exceptions::format("dimension incorrect"));
return Err(Exceptions::formatWith("dimension incorrect"));
}
Self::getVersionForNumber((dimension - 17) / 4)
}
pub fn getVersionForNumber(versionNumber: u32) -> Result<&'static Version, Exceptions> {
if !(1..=40).contains(&versionNumber) {
return Err(Exceptions::illegalArgument("version out of spec"));
return Err(Exceptions::illegalArgumentWith("version out of spec"));
}
Ok(&VERSIONS[versionNumber as usize - 1])
}
@@ -136,7 +136,7 @@ impl Version {
return Self::getVersionForNumber(bestVersion);
}
// If we didn't find a close enough match, fail
Err(Exceptions::notFoundEmpty())
Err(Exceptions::notFound)
}
/**