Rename String.toString back to get()

Since it is expected that the return type of toString() is
immutable(char)[] and not char[] or const(char)[].
This commit is contained in:
Eugen Wissner 2017-05-29 11:41:49 +02:00
parent 8ee1d647ce
commit 6c0588164a
3 changed files with 5 additions and 7 deletions

View File

@ -160,7 +160,7 @@ struct Range(E)
return typeof(return)(*this.container, this.begin + i, this.begin + j);
}
inout(E[]) get() inout @trusted
inout(E)[] get() inout @trusted
{
return this.begin[0 .. length];
}

View File

@ -27,6 +27,9 @@ import tanya.memory;
*/
struct Range(E)
{
private alias ContainerType = CopyConstness!(E, Array!(Bucket!(Unqual!E)));
private ContainerType* container;
@disable this();
@property Range save()

View File

@ -199,12 +199,7 @@ struct ByCodeUnit(E)
return typeof(return)(*this.container, this.begin + i, this.begin + j);
}
const(E)[] toString() const @trusted
{
return this.begin[0 .. length];
}
E[] toString() @trusted
inout(E)[] get() inout @trusted
{
return this.begin[0 .. length];
}