Skip to content

Commit bf0c534

Browse files
committed
Fix error with GDC's format()
1 parent 33e4d4d commit bf0c534

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

source/BrightProof.d

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,16 @@ struct SemVer {
153153
* Returns: SemVer in string (MAJOR.MINOR.PATCH-PRERELEASE+BUILD)
154154
*/
155155
string toString() {
156-
import std.format : format;
157-
string o = format("%d.%d.%d", Major, Minor, Patch);
156+
import std.array : appender;
157+
import std.format : formattedWrite;
158+
159+
auto writer = appender!string();
160+
formattedWrite(writer, "%d.%d.%d", Major, Minor, Patch);
158161
if(PreRelease != "")
159-
o ~= format("-%s", PreRelease);
162+
formattedWrite(writer, "-%s", PreRelease);
160163
if(Build != "")
161-
o ~= format("+%s", Build);
162-
return o;
164+
formattedWrite(writer, "+%s", Build);
165+
return writer.data;
163166
}
164167

165168
/**

0 commit comments

Comments
 (0)