Skip to content

Commit

Permalink
Move some deprecations along.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdavis committed Oct 27, 2014
1 parent 621c762 commit 76df657
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 117 deletions.
41 changes: 0 additions & 41 deletions std/complex.d
Expand Up @@ -156,28 +156,6 @@ struct Complex(T) if (isFloatingPoint!T)
sink("i");
}

/*
* Explicitly undocumented. It will be removed in October 2014.
* Please use $(XREF string,format) instead.
*/
deprecated("Please use std.string.format instead.")
string toString(scope void delegate(const(char)[]) sink,
string formatSpec = "%s")
const
{
if (sink == null)
{
import std.exception : assumeUnique;
char[] buf;
buf.reserve(100);
formattedWrite((const(char)[] s) { buf ~= s; }, formatSpec, this);
return assumeUnique(buf);
}

formattedWrite(sink, formatSpec, this);
return null;
}

@safe pure nothrow @nogc:

this(R : T)(Complex!R z)
Expand Down Expand Up @@ -633,25 +611,6 @@ unittest
assert (z.re == 2.0 && z.im == 2.0);
}

deprecated unittest
{
// Convert to string.

// Using default format specifier
auto z1 = Complex!real(0.123456789, 0.123456789);
char[] s1;
z1.toString((const(char)[] c) { s1 ~= c; });
assert (s1 == "0.123457+0.123457i");
assert (s1 == z1.toString());

// Using custom format specifier
auto z2 = conj(z1);
char[] s2;
z2.toString((const(char)[] c) { s2 ~= c; }, "%.8e");
assert (s2 == "1.23456789e-01-1.23456789e-01i");
assert (s2 == z2.toString(null, "%.8e"));
}


/* Makes Complex!(Complex!T) fold to Complex!T.
Expand Down
13 changes: 1 addition & 12 deletions std/file.d
Expand Up @@ -3001,18 +3001,7 @@ auto dirEntries(string path, string pattern, SpanMode mode,
return filter!f(DirIterator(path, mode, followSymlink));
}

/++
$(RED Deprecated. It will be removed in July 2014.
Please use $(LREF DirEntry) constructor directly instead.)
Returns a DirEntry for the given file (or directory).
Params:
name = The file (or directory) to get a DirEntry for.
Throws:
$(D FileException) if the file does not exist.
+/
// Explicitly undocumented. It will be removed in July 2015.
deprecated("Please use DirEntry constructor directly instead.")
DirEntry dirEntry(in char[] name)
{
Expand Down
2 changes: 1 addition & 1 deletion std/metastrings.d
@@ -1,3 +1,3 @@
// Scheduled for removal in April 2014.
// Explicitly undocumented. It will be removed in April 2015.
deprecated("Please use std.string.format, std.conv.to or std.conv.parse instead")
module std.metastrings;
49 changes: 0 additions & 49 deletions std/string.d
Expand Up @@ -3341,55 +3341,6 @@ unittest
});
}

// Explicitly undocumented. It will be removed in July 2014.
deprecated("Please use std.string.format instead.") alias xformat = format;

deprecated unittest
{
debug(string) printf("std.string.xformat.unittest\n");

assertCTFEable!(
{
// assert(xformat(null) == "");
assert(xformat("foo") == "foo");
assert(xformat("foo%%") == "foo%");
assert(xformat("foo%s", 'C') == "fooC");
assert(xformat("%s foo", "bar") == "bar foo");
assert(xformat("%s foo %s", "bar", "abc") == "bar foo abc");
assert(xformat("foo %d", -123) == "foo -123");
assert(xformat("foo %d", 123) == "foo 123");

assertThrown!FormatException(xformat("foo %s"));
assertThrown!FormatException(xformat("foo %s", 123, 456));
});
}

// Explicitly undocumented. It will be removed in July 2014.
deprecated("Please use std.string.sformat instead.") alias xsformat = sformat;

deprecated unittest
{
debug(string) printf("std.string.xsformat.unittest\n");

assertCTFEable!(
{
char[10] buf;

assert(xsformat(buf[], "foo") == "foo");
assert(xsformat(buf[], "foo%%") == "foo%");
assert(xsformat(buf[], "foo%s", 'C') == "fooC");
assert(xsformat(buf[], "%s foo", "bar") == "bar foo");
assertThrown!RangeError(xsformat(buf[], "%s foo %s", "bar", "abc"));
assert(xsformat(buf[], "foo %d", -123) == "foo -123");
assert(xsformat(buf[], "foo %d", 123) == "foo 123");

assertThrown!FormatException(xsformat(buf[], "foo %s"));
assertThrown!FormatException(xsformat(buf[], "foo %s", 123, 456));

assert(xsformat(buf[], "%s %s %s", "c"c, "w"w, "d"d) == "c w d");
});
}


/***********************************************
* See if character c is in the pattern.
Expand Down
14 changes: 0 additions & 14 deletions std/windows/registry.d
Expand Up @@ -1279,20 +1279,6 @@ public:
return value;
}

//Explicitly undocumented. It will be removed in July 2014.
deprecated("Please use value_DWORD instead.")
uint value_DWORD_LITTLEENDIAN()
{
return value_DWORD;
}

//Explicitly undocumented. It will be removed in July 2014.
deprecated("Please use value_DWORD instead.")
uint value_DWORD_BIGENDIAN()
{
return value_DWORD;
}

/**
Obtains the value as a 64-bit unsigned integer, ordered correctly
according to the current architecture.
Expand Down

0 comments on commit 76df657

Please sign in to comment.