diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-11-04 16:50:00 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-11-04 16:50:00 -0500 |
commit | 88dce820d52f7e09ce5424e13b34d6c10d5868ed (patch) | |
tree | 5a85bf951ebffa09215f0035ef3d6b5c4bf3f9d5 /src/SMAPI.Toolkit | |
parent | 01c612bc4aca5a1d8921432c94956f4d170d4d4b (diff) | |
download | SMAPI-88dce820d52f7e09ce5424e13b34d6c10d5868ed.tar.gz SMAPI-88dce820d52f7e09ce5424e13b34d6c10d5868ed.tar.bz2 SMAPI-88dce820d52f7e09ce5424e13b34d6c10d5868ed.zip |
no longer omit zero patch numbers when formatting versions
Diffstat (limited to 'src/SMAPI.Toolkit')
-rw-r--r-- | src/SMAPI.Toolkit/SemanticVersion.cs | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/SMAPI.Toolkit/SemanticVersion.cs b/src/SMAPI.Toolkit/SemanticVersion.cs index 6d5d65ac..2ce3578e 100644 --- a/src/SMAPI.Toolkit/SemanticVersion.cs +++ b/src/SMAPI.Toolkit/SemanticVersion.cs @@ -172,16 +172,10 @@ namespace StardewModdingAPI.Toolkit /// <summary>Get a string representation of the version.</summary> public override string ToString() { - // version - string result = this.PatchVersion != 0 - ? $"{this.MajorVersion}.{this.MinorVersion}.{this.PatchVersion}" - : $"{this.MajorVersion}.{this.MinorVersion}"; - - // tag - string tag = this.PrereleaseTag; - if (tag != null) - result += $"-{tag}"; - return result; + string version = $"{this.MajorVersion}.{this.MinorVersion}.{this.PatchVersion}"; + if (this.PrereleaseTag != null) + version += $"-{this.PrereleaseTag}"; + return version; } /// <summary>Parse a version string without throwing an exception if it fails.</summary> |