Skip to content

Commit

Permalink
Merge pull request #2731 from 9il/ktf
Browse files Browse the repository at this point in the history
use Flag!"KeepTerminator" / Flag!"CaseSensitive"
  • Loading branch information
MartinNowak committed Nov 17, 2014
2 parents ea52f8e + 76eebfe commit bc138d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion std/net/curl.d
Expand Up @@ -899,7 +899,7 @@ private auto _decodeContent(T)(ubyte[] content, string encoding)
}
}

alias KeepTerminator = std.string.KeepTerminator;
alias KeepTerminator = Flag!"KeepTerminator";
/++
struct ByLineBuffer(Char)
{
Expand Down
5 changes: 3 additions & 2 deletions std/string.d
Expand Up @@ -97,6 +97,7 @@ void trustedPrintf(in char* str) @trusted nothrow @nogc
}

public import std.uni : icmp, toLower, toLowerInPlace, toUpper, toUpperInPlace;
import std.typecons : Flag;

import std.range.constraints;
import std.traits;
Expand Down Expand Up @@ -263,7 +264,7 @@ pure nothrow unittest
/**
Flag indicating whether a search is case-sensitive.
*/
enum CaseSensitive { no, yes }
alias CaseSensitive = Flag!"CaseSensitive";

/++
Returns the index of the first occurrence of $(D c) in $(D s). If $(D c)
Expand Down Expand Up @@ -1892,7 +1893,7 @@ S capitalize(S)(S s) @trusted pure
If $(D keepTerm) is set to $(D KeepTerminator.yes), then the delimiter
is included in the strings returned.
+/
enum KeepTerminator : bool { no, yes }
alias KeepTerminator = Flag!"KeepTerminator";
/// ditto
S[] splitLines(S)(S s, in KeepTerminator keepTerm = KeepTerminator.no) @safe pure
if (isSomeString!S)
Expand Down

0 comments on commit bc138d4

Please sign in to comment.