Skip to content

Commit db5480c

Browse files
committed
Added immutable to never modified variables in std.net.email
1 parent 9785c78 commit db5480c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

std/net/isemail.d

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ EmailStatus isEmail (Char) (const(Char)[] email, CheckDns checkDNS = No.checkDns
242242
else
243243
{
244244
contextPrior = context;
245-
auto c = token.front;
245+
immutable c = token.front;
246246

247247
if (c < '!' || c > '~' || c == '\n' || Token.specials.canFind(token))
248248
returnStatus ~= EmailStatusCode.errorExpectingText;
@@ -360,7 +360,7 @@ EmailStatus isEmail (Char) (const(Char)[] email, CheckDns checkDNS = No.checkDns
360360

361361
}
362362

363-
auto c = token.front;
363+
immutable c = token.front;
364364
hyphenFlag = false;
365365

366366
if (c < '!' || c > '~' || Token.specials.canFind(token))
@@ -414,7 +414,7 @@ EmailStatus isEmail (Char) (const(Char)[] email, CheckDns checkDNS = No.checkDns
414414
{
415415
auto ipV6 = addressLiteral.substr(5);
416416
matchesIp = ipV6.split(Token.colon);
417-
auto groupCount = matchesIp.length;
417+
immutable groupCount = matchesIp.length;
418418
index = ipV6.indexOf(Token.doubleColon);
419419

420420
if (index == -1)
@@ -487,7 +487,7 @@ EmailStatus isEmail (Char) (const(Char)[] email, CheckDns checkDNS = No.checkDns
487487
break;
488488

489489
default:
490-
auto c = token.front;
490+
immutable c = token.front;
491491

492492
if (c > AsciiToken.delete_ || c == '\0' || token == Token.openBracket)
493493
{
@@ -540,7 +540,7 @@ EmailStatus isEmail (Char) (const(Char)[] email, CheckDns checkDNS = No.checkDns
540540
break;
541541

542542
default:
543-
auto c = token.front;
543+
immutable c = token.front;
544544

545545
if (c > AsciiToken.delete_ || c == '\0' || c == '\n')
546546
returnStatus ~= EmailStatusCode.errorExpectingQuotedText;
@@ -555,7 +555,7 @@ EmailStatus isEmail (Char) (const(Char)[] email, CheckDns checkDNS = No.checkDns
555555
break;
556556

557557
case EmailPart.contextQuotedPair:
558-
auto c = token.front;
558+
immutable c = token.front;
559559

560560
if (c > AsciiToken.delete_)
561561
returnStatus ~= EmailStatusCode.errorExpectingQuotedPair;
@@ -623,7 +623,7 @@ EmailStatus isEmail (Char) (const(Char)[] email, CheckDns checkDNS = No.checkDns
623623
break;
624624

625625
default:
626-
auto c = token.front;
626+
immutable c = token.front;
627627

628628
if (c > AsciiToken.delete_ || c == '\0' || c == '\n')
629629
{

0 commit comments

Comments
 (0)