File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -1255,14 +1255,15 @@ Params:
12551255
12561256Returns:
12571257 A $(D FormatSpec) with the specifier parsed.
1258-
1259- Enforces giving only one specifier to the function.
1258+ Throws:
1259+ An `Exception` when more than one specifier is given or the specifier
1260+ is malformed.
12601261 */
12611262FormatSpec! Char singleSpec (Char)(Char[] fmt)
12621263{
12631264 import std.conv : text;
1264- enforce(fmt.length >= 2 , new Exception ( " fmt must be at least 2 characters long" ) );
1265- enforce(fmt.front == ' %' , new Exception ( " fmt must start with a '%' character" ) );
1265+ enforce(fmt.length >= 2 , " fmt must be at least 2 characters long" );
1266+ enforce(fmt.front == ' %' , " fmt must start with a '%' character" );
12661267
12671268 static struct DummyOutputRange {
12681269 void put (C)(C[] buf) {} // eat elements
@@ -1273,7 +1274,7 @@ FormatSpec!Char singleSpec(Char)(Char[] fmt)
12731274 spec.writeUpToNextSpec(a);
12741275
12751276 enforce(spec.trailing.empty,
1276- new Exception ( text(" Trailing characters in fmt string: '" , spec.trailing) ));
1277+ text(" Trailing characters in fmt string: '" , spec.trailing));
12771278
12781279 return spec;
12791280}
You can’t perform that action at this time.
0 commit comments