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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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]