1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

math.unsigned: change uint256_from_dec_str to return a result, instead of an option (#19041)

This commit is contained in:
blackshirt 2023-08-03 14:18:21 +07:00 committed by GitHub
parent 5ec7ee916a
commit ef5c3cdb73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -382,7 +382,7 @@ pub fn (u_ Uint256) str() string {
}
// uint256_from_dec_str creates a new `unsigned.Uint256` from the given string if possible
pub fn uint256_from_dec_str(value string) ?Uint256 {
pub fn uint256_from_dec_str(value string) !Uint256 {
mut res := unsigned.uint256_zero
for b_ in value.bytes() {
b := b_ - '0'.bytes()[0]