Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions std/conv.d
Original file line number Diff line number Diff line change
Expand Up @@ -2135,12 +2135,12 @@ Lerr:
///
@safe pure unittest
{
import std.string : munch;
import std.string : tr;
string test = "123 \t 76.14";
auto a = parse!uint(test);
assert(a == 123);
assert(test == " \t 76.14"); // parse bumps string
munch(test, " \t\n\r"); // skip ws
test = tr(test, " \t\n\r", "", "d"); // skip ws
assert(test == "76.14");
auto b = parse!double(test);
assert(b == 76.14);
Expand Down
18 changes: 10 additions & 8 deletions std/uri.d
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,12 @@ if (isSomeChar!Char)
string decode(Char)(in Char[] encodedURI)
if (isSomeChar!Char)
{
// selective imports trigger wrong deprecation
// https://issues.dlang.org/show_bug.cgi?id=17193
static import std.utf;
import std.utf : encode;
import std.algorithm.iteration : each;
auto s = URI_Decode(encodedURI, URI_Reserved | URI_Hash);
return std.utf.toUTF8(s);
char[] r;
s.each!(c => encode(r, c));
return r;
}

/*******************************
Expand All @@ -331,11 +332,12 @@ if (isSomeChar!Char)
string decodeComponent(Char)(in Char[] encodedURIComponent)
if (isSomeChar!Char)
{
// selective imports trigger wrong deprecation
// https://issues.dlang.org/show_bug.cgi?id=17193
static import std.utf;
import std.utf : encode;
import std.algorithm.iteration : each;
auto s = URI_Decode(encodedURIComponent, 0);
return std.utf.toUTF8(s);
char[] r;
s.each!(c => encode(r, c));
return r;
}

/*****************************
Expand Down