From bc83bb2d82d97f36a2f10700636e52d3ffe7eb8d Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Sat, 11 Mar 2017 02:15:07 +0000 Subject: [PATCH 1/3] std.utf: Fix missing import in documented unittest Fixes CircleCI. --- std/utf.d | 2 ++ 1 file changed, 2 insertions(+) diff --git a/std/utf.d b/std/utf.d index e7144f4d7e9..8c09663c29a 100644 --- a/std/utf.d +++ b/std/utf.d @@ -3425,6 +3425,8 @@ if (isAutodecodableString!R || /// @safe unittest { + import std.range.primitives; + auto r = "Hello, World!".byCodeUnit(); static assert(hasLength!(typeof(r))); static assert(hasSlicing!(typeof(r))); From 05641deb9cb3d835a6f97cad421cf9c09ddd92de Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Sat, 11 Mar 2017 02:22:46 +0000 Subject: [PATCH 2/3] std.utf: Fix style (space after `cast(x)`) --- std/utf.d | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/std/utf.d b/std/utf.d index 8c09663c29a..375938b989a 100644 --- a/std/utf.d +++ b/std/utf.d @@ -3546,7 +3546,7 @@ if (isAutodecodableString!R || static assert(!is(typeof(bcu) == Stringish)); static assert(is(typeof(bcu) == typeof(bcu.byCodeUnit()))); static assert(is(ElementType!(typeof(bcu)) == immutable char)); - assert(bcu.front == cast(char)244); + assert(bcu.front == cast(char) 244); } { static struct WStringish @@ -3561,7 +3561,7 @@ if (isAutodecodableString!R || static assert(!is(typeof(bcu) == WStringish)); static assert(is(typeof(bcu) == typeof(bcu.byCodeUnit()))); static assert(is(ElementType!(typeof(bcu)) == immutable wchar)); - assert(bcu.front == cast(wchar)56319); + assert(bcu.front == cast(wchar) 56319); } { static struct DStringish @@ -3575,7 +3575,7 @@ if (isAutodecodableString!R || static assert(is(typeof(bcu) == dstring)); static assert(is(typeof(bcu) == typeof(bcu.byCodeUnit()))); static assert(is(ElementType!(typeof(bcu)) == immutable dchar)); - assert(bcu.front == cast(dchar)1114104); + assert(bcu.front == cast(dchar) 1114104); } { static struct FuncStringish @@ -3591,7 +3591,7 @@ if (isAutodecodableString!R || static assert(!is(typeof(bcu) == FuncStringish)); static assert(is(typeof(bcu) == typeof(bcu.byCodeUnit()))); static assert(is(ElementType!(typeof(bcu)) == immutable char)); - assert(bcu.front == cast(char)244); + assert(bcu.front == cast(char) 244); } { static struct Range @@ -3607,7 +3607,7 @@ if (isAutodecodableString!R || static assert(is(typeof(bcu) == Range)); static assert(is(typeof(bcu) == typeof(bcu.byCodeUnit()))); static assert(is(ElementType!(typeof(bcu)) == char)); - assert(bcu.front == cast(char)244); + assert(bcu.front == cast(char) 244); } { static struct WRange From 86c43140fbf4b33c07299ba95aecdf1a11875c1b Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Sat, 11 Mar 2017 02:53:33 +0000 Subject: [PATCH 3/3] std.utf: Fix style (space around ..) --- std/utf.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/std/utf.d b/std/utf.d index 375938b989a..29609a42688 100644 --- a/std/utf.d +++ b/std/utf.d @@ -3397,7 +3397,7 @@ if (isAutodecodableString!R || void popBack() { str = str[0 .. $-1]; } auto ref opIndex(size_t index) inout { return str[index]; } - auto opSlice(size_t lower, size_t upper) { return ByCodeUnitImpl(str[lower..upper]); } + auto opSlice(size_t lower, size_t upper) { return ByCodeUnitImpl(str[lower .. upper]); } @property size_t length() const { return str.length; } alias opDollar = length;