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

semver: run v fmt (#7439)

This commit is contained in:
zakuro
2020-12-22 04:25:19 +09:00
committed by GitHub
parent 805ec8e177
commit fade162471
5 changed files with 15 additions and 45 deletions

View File

@ -21,16 +21,12 @@ fn parse(input string) RawVersion {
mut raw_version := input
mut prerelease := ''
mut metadata := ''
plus_idx := raw_version.last_index('+') or {
-1
}
plus_idx := raw_version.last_index('+') or { -1 }
if plus_idx > 0 {
metadata = raw_version[(plus_idx + 1)..]
raw_version = raw_version[0..plus_idx]
}
hyphen_idx := raw_version.index('-') or {
-1
}
hyphen_idx := raw_version.index('-') or { -1 }
if hyphen_idx > 0 {
prerelease = raw_version[(hyphen_idx + 1)..]
raw_version = raw_version[0..hyphen_idx]