Skip to content

Commit 91eaa50

Browse files
committed
Address review
1 parent ca0777a commit 91eaa50

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

std/net/curl.d

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ Distributed under the Boost Software License, Version 1.0.
157157
module std.net.curl;
158158

159159
public import etc.c.curl : CurlOption;
160+
import core.time : dur;
161+
import etc.c.curl : CURLcode;
160162
import std.concurrency : Tid;
161163
import std.range.primitives;
162164
import std.encoding : EncodingScheme;
@@ -165,6 +167,8 @@ import std.typecons : Flag, Yes, No, Tuple;
165167

166168
version(unittest)
167169
{
170+
import std.socket : Socket;
171+
168172
// Run unit test with the PHOBOS_TEST_ALLOW_NET=1 set in order to
169173
// allow net traffic
170174
private struct TestServer
@@ -232,11 +236,8 @@ version(unittest)
232236
immutable(T)[] bdy;
233237
}
234238

235-
private Request!T recvReq(T=char, S)(S s)
239+
private Request!T recvReq(T=char)(Socket s)
236240
{
237-
import std.socket : Socket;
238-
static assert (is(S == Socket), "Invalid type used. Use std.socket.Socket.");
239-
240241
import std.algorithm.comparison : min;
241242
import std.algorithm.searching : find, canFind;
242243
import std.conv : to;
@@ -313,11 +314,7 @@ version(unittest)
313314
version(StdDdoc) import std.stdio;
314315

315316
// Default data timeout for Protocols
316-
private auto _defaultDataTimeout() {
317-
import core.time : dur;
318-
static res = dur!"minutes"(2);
319-
return res;
320-
}
317+
enum _defaultDataTimeout = dur!"minutes"(2);
321318

322319
/**
323320
Macros:
@@ -4144,7 +4141,6 @@ class HTTPStatusException : CurlException
41444141
immutable int status; /// The HTTP status code
41454142
}
41464143

4147-
import etc.c.curl : CURLcode;
41484144
/// Equal to $(REF CURLcode, etc,c,curl)
41494145
alias CurlCode = CURLcode;
41504146

@@ -4352,7 +4348,7 @@ struct Curl
43524348
interleavefunction, chunk_data, chunk_bgn_function,
43534349
chunk_end_function, fnmatch_data, fnmatch_function, cookiejar, postfields);
43544350

4355-
static foreach (option; tt)
4351+
foreach (option; tt)
43564352
copy.clear(option);
43574353
}
43584354

0 commit comments

Comments
 (0)