Permalink
Browse files

Fix some deprecation warnings.

  • Loading branch information...
s-ludwig committed Mar 17, 2018
1 parent 1b52202 commit 9f1a72b1642e1ac5268149d9881a9e7f89ddd641
Showing with 18 additions and 2 deletions.
  1. +1 −1 inet/vibe/inet/urltransfer.d
  2. +17 −1 stream/vibe/stream/operations.d
@@ -110,7 +110,7 @@ void download()(string url, string filename)
}
/// ditto
void download()(URL url, Path filename)
void download()(URL url, NativePath filename)
{
download(url.toString(), filename.toNativeString());
}
@@ -17,9 +17,9 @@ import vibe.stream.wrapper : ProxyStream;
import std.algorithm;
import std.array;
import std.datetime;
import std.exception;
import std.range : isOutputRange;
import core.time : Duration, seconds;
/**************************************************************************************************/
@@ -288,6 +288,10 @@ string readAllUTF8(InputStream)(InputStream stream, bool sanitize = false, size_
void pipeRealtime(OutputStream, ConnectionStream)(OutputStream destination, ConnectionStream source, ulong nbytes = 0, Duration max_latency = 0.seconds)
if (isOutputStream!OutputStream && isConnectionStream!ConnectionStream)
{
static if (__VERSION__ >= 2077)
import std.datetime.stopwatch : StopWatch;
else import std.datetime : StopWatch;
import vibe.internal.freelistref;
static struct Buffer { ubyte[64*1024] bytes = void; }
@@ -327,6 +331,18 @@ void pipeRealtime(OutputStream, ConnectionStream)(OutputStream destination, Conn
destination.flush();
}
unittest {
import vibe.core.net : TCPConnection;
import vibe.core.stream : nullSink;
void test()
{
TCPConnection c;
pipeRealtime(nullSink, c);
}
}
/**
Consumes `bytes.length` bytes of the stream and determines if the contents
match up.

0 comments on commit 9f1a72b

Please sign in to comment.