From a227b58407b204f9025f11220f2a32911ad8ffb9 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Wed, 6 May 2020 07:08:14 +0200 Subject: [PATCH] Remove deprecated functionality --- middle/tanya/memory/package.d | 2 -- source/tanya/algorithm/mutation.d | 9 ------ source/tanya/conv.d | 2 -- source/tanya/format.d | 20 -------------- source/tanya/net/ip.d | 46 ++++--------------------------- source/tanya/range/primitive.d | 8 +----- source/tanya/typecons.d | 10 ------- 7 files changed, 7 insertions(+), 90 deletions(-) diff --git a/middle/tanya/memory/package.d b/middle/tanya/memory/package.d index 12a122a..61e98d2 100644 --- a/middle/tanya/memory/package.d +++ b/middle/tanya/memory/package.d @@ -16,5 +16,3 @@ module tanya.memory; public import tanya.memory.allocator; public import tanya.memory.lifetime; -deprecated("Use tanya.meta.trait.stateSize instead") -public import tanya.meta.trait : stateSize; diff --git a/source/tanya/algorithm/mutation.d b/source/tanya/algorithm/mutation.d index e337e10..9d9523d 100644 --- a/source/tanya/algorithm/mutation.d +++ b/source/tanya/algorithm/mutation.d @@ -20,15 +20,6 @@ import tanya.meta.trait; import tanya.meta.transform; import tanya.range; -deprecated("Use tanya.memory.lifetime.swap instead") -alias swap = tanya.memory.lifetime.swap; - -deprecated("Use tanya.memory.lifetime.moveEmplace instead") -alias moveEmplace = tanya.memory.lifetime.moveEmplace; - -deprecated("Use tanya.memory.lifetime.move instead") -alias move = tanya.memory.lifetime.move; - /** * Copies the $(D_PARAM source) range into the $(D_PARAM target) range. * diff --git a/source/tanya/conv.d b/source/tanya/conv.d index 5a7b971..84dc8f5 100644 --- a/source/tanya/conv.d +++ b/source/tanya/conv.d @@ -17,8 +17,6 @@ module tanya.conv; import std.traits : Unsigned; import tanya.container.string; import tanya.memory.allocator; -deprecated("Use tanya.memory.lifetime.emplace instead") -public import tanya.memory.lifetime : emplace; import tanya.meta.trait; import tanya.meta.transform; import tanya.range; diff --git a/source/tanya/format.d b/source/tanya/format.d index 12bb8e6..b89bbf9 100644 --- a/source/tanya/format.d +++ b/source/tanya/format.d @@ -2253,26 +2253,6 @@ private void printToString(string fmt, OR, Args...)(ref OR result, { formatRange(args[0], result); } - else static if (is(Unqual!(typeof(args[0].stringify())) == String)) - { - pragma(msg, ".stringify() is deprecated. Use toString() with an output" - ~ " range instead"); - static if (is(Arg == class) || is(Arg == interface)) - { - if (args[0] is null) - { - put(result, "null"); - } - else - { - put(result, args[0].stringify()[]); - } - } - else - { - put(result, args[0].stringify()[]); - } - } else static if (is(typeof(args[0].toString(result)) == OR)) { static if (is(Arg == class) || is(Arg == interface)) diff --git a/source/tanya/net/ip.d b/source/tanya/net/ip.d index 3afa50e..294ac95 100644 --- a/source/tanya/net/ip.d +++ b/source/tanya/net/ip.d @@ -94,8 +94,8 @@ struct Address4 /// @nogc nothrow pure @safe unittest { - assert(address4("127.0.0.1") > address4("126.0.0.0")); - assert(address4("127.0.0.1") < address4("127.0.0.2")); + assert(address4("127.0.0.1").get > address4("126.0.0.0").get); + assert(address4("127.0.0.1").get < address4("127.0.0.2").get); assert(address4("127.0.0.1") == address4("127.0.0.1")); } @@ -233,26 +233,6 @@ struct Address4 assert(address4("192.168.0.1").get.isUnicast()); } - /** - * Produces a string containing an IPv4 address in dotted-decimal notation. - * - * Returns: This address in dotted-decimal notation. - */ - deprecated("Use Address4.toString() instead") - String stringify() const @nogc nothrow pure @safe - { - const octets = (() @trusted => (cast(ubyte*) &this.address)[0 .. 4])(); - enum string fmt = "{}.{}.{}.{}"; - version (LittleEndian) - { - return format!fmt(octets[0], octets[1], octets[2], octets[3]); - } - else - { - return format!fmt(octets[3], octets[2], octets[1], octets[0]); - } - } - /** * Writes this IPv4 address in dotted-decimal notation. * @@ -502,11 +482,11 @@ struct Address6 /// @nogc nothrow @safe unittest { - assert(address6("::14") > address6("::1")); - assert(address6("::1") < address6("::14")); + assert(address6("::14").get > address6("::1").get); + assert(address6("::1").get < address6("::14").get); assert(address6("::1") == address6("::1")); - assert(address6("fe80::1%1") < address6("fe80::1%2")); - assert(address6("fe80::1%2") > address6("fe80::1%1")); + assert(address6("fe80::1%1").get < address6("fe80::1%2").get); + assert(address6("fe80::1%2").get > address6("fe80::1%1").get); } /** @@ -650,20 +630,6 @@ struct Address6 assert(address6("fd80:124e:34f3::1").get.isUniqueLocal()); } - /** - * Returns text representation of this address. - * - * Returns: text representation of this address. - */ - deprecated("Use Address6.toString() instead") - String stringify() const @nogc nothrow pure @safe - { - String output; - - toString(backInserter(output)); - return output; - } - /** * Writes text representation of this address to an output range. * diff --git a/source/tanya/range/primitive.d b/source/tanya/range/primitive.d index 06c653b..1296dad 100644 --- a/source/tanya/range/primitive.d +++ b/source/tanya/range/primitive.d @@ -630,13 +630,7 @@ template isRandomAccessRange(R) */ void put(R, E)(ref R range, auto ref E e) { - static if (__traits(hasMember, R, "put") - && is(typeof((R r, E e) => r.put(e)))) - { - pragma(msg, "OutputRange.put()-primitive is deprecated. Define opCall() instead."); - range.put(e); - } - else static if (is(typeof((R r, E e) => r(e)))) + static if (is(typeof((R r, E e) => r(e)))) { range(e); } diff --git a/source/tanya/typecons.d b/source/tanya/typecons.d index 26d4784..984f809 100644 --- a/source/tanya/typecons.d +++ b/source/tanya/typecons.d @@ -211,14 +211,6 @@ struct Option(T) return this.value; } - /// ditto - deprecated("Call Option.get explicitly instead of relying on alias this") - @property ref inout(T) get_() inout - in (!isNothing, "Option is nothing") - { - return this.value; - } - /** * Returns the encapsulated value if available or a default value * otherwise. @@ -384,8 +376,6 @@ struct Option(T) return isNothing ? 0U : this.value.toHash(); } } - - alias get_ this; } ///