@@ -2418,11 +2418,7 @@ void validate(S)(in S str) @safe pure
24182418}
24192419
24202420/* =================== Conversion to UTF8 ======================= */
2421-
2422- pure
2423- {
2424-
2425- char [] toUTF8 (return out char [4 ] buf, dchar c) nothrow @nogc @safe
2421+ char [] toUTF8 (return out char [4 ] buf, dchar c) nothrow @nogc @safe pure
24262422{
24272423 if (c <= 0x7F )
24282424 {
@@ -2493,7 +2489,7 @@ string toUTF8(S)(S s) if (isSomeString!S)
24932489
24942490/* =================== Conversion to UTF16 ======================= */
24952491
2496- wchar [] toUTF16 (return ref wchar [2 ] buf, dchar c) nothrow @nogc @safe
2492+ wchar [] toUTF16 (return ref wchar [2 ] buf, dchar c) nothrow @nogc @safe pure
24972493in
24982494{
24992495 assert (isValidDchar(c));
@@ -2516,7 +2512,7 @@ body
25162512/* ***************
25172513 * Encodes string $(D s) into UTF-16 and returns the encoded string.
25182514 */
2519- wstring toUTF16 (scope const char [] s) @safe
2515+ wstring toUTF16 (scope const char [] s) @safe pure
25202516{
25212517 wchar [] r;
25222518 immutable slen = s.length;
@@ -2542,14 +2538,14 @@ wstring toUTF16(scope const char[] s) @safe
25422538}
25432539
25442540// / ditto
2545- wstring toUTF16 (scope const wchar [] s) @safe
2541+ wstring toUTF16 (scope const wchar [] s) @safe pure
25462542{
25472543 validate(s);
25482544 return s.idup;
25492545}
25502546
25512547// / ditto
2552- wstring toUTF16 (scope const dchar [] s) @safe
2548+ wstring toUTF16 (scope const dchar [] s) @safe pure
25532549{
25542550 wchar [] r;
25552551 immutable slen = s.length;
@@ -2570,7 +2566,7 @@ wstring toUTF16(scope const dchar[] s) @safe
25702566/* ****
25712567 * Encodes string $(D_PARAM s) into UTF-32 and returns the encoded string.
25722568 */
2573- dstring toUTF32 (scope const char [] s) @safe
2569+ dstring toUTF32 (scope const char [] s) @safe pure
25742570{
25752571 dchar [] r;
25762572 immutable slen = s.length;
@@ -2591,7 +2587,7 @@ dstring toUTF32(scope const char[] s) @safe
25912587}
25922588
25932589// / ditto
2594- dstring toUTF32 (scope const wchar [] s) @safe
2590+ dstring toUTF32 (scope const wchar [] s) @safe pure
25952591{
25962592 dchar [] r;
25972593 immutable slen = s.length;
@@ -2612,15 +2608,12 @@ dstring toUTF32(scope const wchar[] s) @safe
26122608}
26132609
26142610// / ditto
2615- dstring toUTF32 (scope const dchar [] s) @safe
2611+ dstring toUTF32 (scope const dchar [] s) @safe pure
26162612{
26172613 validate(s);
26182614 return s.idup;
26192615}
26202616
2621- } // Convert functions are @safe
2622-
2623-
26242617/* =================== toUTFz ======================= */
26252618
26262619/+ +
0 commit comments