Bug 23724 – HTTP.onReceive example does not compile
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-02-17T22:50:39Z
Last change time
2023-02-17T23:40:32Z
Keywords
pull
Assigned to
No Owner
Creator
Paul Backus
Comments
Comment #0 by snarwin+bugzilla — 2023-02-17T22:50:39Z
The following example from the documentation of std.net.curl.HTTP.onReceive does not compile:
---
import std.net.curl, std.stdio;
auto client = HTTP("dlang.org");
client.onReceive = (ubyte[] data)
{
writeln("Got data", to!(const(char)[])(data));
return data.length;
};
client.perform();
---
The error message is:
---
Error: template instance `to!(const(char)[])` template `to` is not defined
---
Comment #1 by dlang-bot — 2023-02-17T23:10:46Z
@pbackus created dlang/phobos pull request #8688 "std.net.curl: add missing import to examples" fixing this issue:
- std.net.curl: add missing import to examples
Fixes issue 23724 - HTTP.onReceive example does not compile
https://github.com/dlang/phobos/pull/8688
Comment #2 by dlang-bot — 2023-02-17T23:40:32Z
dlang/phobos pull request #8688 "std.net.curl: add missing import to examples" was merged into master:
- 134becc7356e912ac5406827f8376480d68163f8 by Paul Backus:
std.net.curl: add missing import to examples
Fixes issue 23724 - HTTP.onReceive example does not compile
https://github.com/dlang/phobos/pull/8688