Skip to content

Commit

Permalink
Merge pull request #2164 from nordlow/no-body
Browse files Browse the repository at this point in the history
Replace deprecated keyword `body` with `do`

Signed-off-by: Nicholas Wilson <thewilsonator@users.noreply.github.com>
Signed-off-by: Razvan Nitu <RazvanN7@users.noreply.github.com>
Signed-off-by: Jan Jurzitza <gh@webfreak.org>
Merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
  • Loading branch information
dlang-bot authored Aug 25, 2021
2 parents 55ce1de + 8ad9dcb commit e464804
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion source/dub/dependency.d
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ struct Repository
*/
@property string remote() @nogc nothrow pure @safe
in { assert(m_remote !is null); }
body
do
{
return m_remote;
}
Expand Down
30 changes: 15 additions & 15 deletions source/dub/internal/undead/xml.d
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ class Document : Element
*/
override bool opEquals(scope const Object o) const
{
const doc = toType!(const Document)(o);
const scope doc = toType!(const Document)(o);
return prolog == doc.prolog
&& (cast(const) this).Element.opEquals(cast(const) doc)
&& epilog == doc.epilog;
Expand All @@ -611,7 +611,7 @@ class Document : Element
*/
override int opCmp(scope const Object o) scope const
{
const doc = toType!(const Document)(o);
const scope doc = toType!(const Document)(o);
if (prolog != doc.prolog)
return prolog < doc.prolog ? -1 : 1;
if (int cmp = this.Element.opCmp(doc))
Expand Down Expand Up @@ -842,7 +842,7 @@ class Element : Item
*/
override bool opEquals(scope const Object o) const
{
const element = toType!(const Element)(o);
const scope element = toType!(const Element)(o);
immutable len = items.length;
if (len != element.items.length) return false;
foreach (i; 0 .. len)
Expand All @@ -866,7 +866,7 @@ class Element : Item
*/
override int opCmp(scope const Object o) @safe const
{
const element = toType!(const Element)(o);
const scope element = toType!(const Element)(o);
for (uint i=0; ; ++i)
{
if (i == items.length && i == element.items.length) return 0;
Expand Down Expand Up @@ -1277,7 +1277,7 @@ class Comment : Item
*/
override bool opEquals(scope const Object o) const
{
const item = toType!(const Item)(o);
const scope item = toType!(const Item)(o);
const t = cast(const Comment) item;
return t !is null && content == t.content;
}
Expand All @@ -1296,7 +1296,7 @@ class Comment : Item
*/
override int opCmp(scope const Object o) scope const
{
const item = toType!(const Item)(o);
const scope item = toType!(const Item)(o);
const t = cast(const Comment) item;
return t !is null && (content != t.content
? (content < t.content ? -1 : 1 ) : 0 );
Expand Down Expand Up @@ -1365,7 +1365,7 @@ class CData : Item
*/
override bool opEquals(scope const Object o) const
{
const item = toType!(const Item)(o);
const scope item = toType!(const Item)(o);
const t = cast(const CData) item;
return t !is null && content == t.content;
}
Expand All @@ -1384,7 +1384,7 @@ class CData : Item
*/
override int opCmp(scope const Object o) scope const
{
const item = toType!(const Item)(o);
const scope item = toType!(const Item)(o);
const t = cast(const CData) item;
return t !is null && (content != t.content
? (content < t.content ? -1 : 1 ) : 0 );
Expand Down Expand Up @@ -1442,7 +1442,7 @@ class Text : Item
*/
override bool opEquals(scope const Object o) const
{
const item = toType!(const Item)(o);
const scope item = toType!(const Item)(o);
const t = cast(const Text) item;
return t !is null && content == t.content;
}
Expand All @@ -1461,7 +1461,7 @@ class Text : Item
*/
override int opCmp(scope const Object o) scope const
{
const item = toType!(const Item)(o);
const scope item = toType!(const Item)(o);
const t = cast(const Text) item;
return t !is null
&& (content != t.content ? (content < t.content ? -1 : 1 ) : 0 );
Expand Down Expand Up @@ -1525,7 +1525,7 @@ class XMLInstruction : Item
*/
override bool opEquals(scope const Object o) const
{
const item = toType!(const Item)(o);
const scope item = toType!(const Item)(o);
const t = cast(const XMLInstruction) item;
return t !is null && content == t.content;
}
Expand All @@ -1544,7 +1544,7 @@ class XMLInstruction : Item
*/
override int opCmp(scope const Object o) scope const
{
const item = toType!(const Item)(o);
const scope item = toType!(const Item)(o);
const t = cast(const XMLInstruction) item;
return t !is null
&& (content != t.content ? (content < t.content ? -1 : 1 ) : 0 );
Expand Down Expand Up @@ -1605,7 +1605,7 @@ class ProcessingInstruction : Item
*/
override bool opEquals(scope const Object o) const
{
const item = toType!(const Item)(o);
const scope item = toType!(const Item)(o);
const t = cast(const ProcessingInstruction) item;
return t !is null && content == t.content;
}
Expand All @@ -1624,7 +1624,7 @@ class ProcessingInstruction : Item
*/
override int opCmp(scope const Object o) scope const
{
const item = toType!(const Item)(o);
const scope item = toType!(const Item)(o);
const t = cast(const ProcessingInstruction) item;
return t !is null
&& (content != t.content ? (content < t.content ? -1 : 1 ) : 0 );
Expand Down Expand Up @@ -2955,7 +2955,7 @@ private alias Err = CheckException;

private
{
inout(T) toType(T)(inout Object o)
inout(T) toType(T)(scope return inout Object o)
{
T t = cast(T)(o);
if (t is null)
Expand Down
2 changes: 1 addition & 1 deletion source/dub/packagemanager.d
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ class PackageManager {
*/
Package loadSCMPackage(string name, Dependency dependency)
in { assert(!dependency.repository.empty); }
body {
do {
Package pack;

with (dependency.repository) final switch (kind)
Expand Down
2 changes: 1 addition & 1 deletion source/dub/semver.d
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ unittest {
*/
bool isPreReleaseVersion(string ver) pure @nogc
in { assert(isValidVersion(ver)); }
body {
do {
foreach (i; 0 .. 2) {
auto di = ver.indexOf('.');
assert(di > 0);
Expand Down

0 comments on commit e464804

Please sign in to comment.