jcd/phobos — comment on commit 1639217f7f08a30cdba5af4517ecac9b004c44a2
File: std/net/curl.d line 1315
By jmdavis:

It's very nice to be able to see large blocks of code like this get refactored so that they don't need to be duplicated. And actually, you do a lot of stuff like

static if (is(Conn : AutoProtocol))
{
if (isFTPUrl(url))
return byLineAsync(url, postData, keepTerminator,
terminator, transmitBuffers, FTP());
else
return byLineAsync(url, postData, keepTerminator,
terminator, transmitBuffers, HTTP());
}

which I'd love to see refactored, but I think that you'd end up having to use string mixins to do it, which would definitely reduce the code's readability, so it's probably not a good idea. But at least this much could be reduced.