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

semver: refactor, simplify, fix typo (#18272)

This commit is contained in:
Turiiya
2023-05-27 00:57:02 +02:00
committed by GitHub
parent 3e08487198
commit f9efbdff10
4 changed files with 64 additions and 102 deletions

View File

@ -10,8 +10,7 @@ fn is_version_valid(input string) bool {
[inline]
fn coerce_version(input string) !Version {
raw_ver := parse(input)
ver := raw_ver.coerce() or { return error('Invalid version for input "${input}"') }
return ver
return raw_ver.coerce() or { return error('Invalid version for input "${input}"') }
}
[inline]