Skip to content

Commit

Permalink
Use selective top-level module imports in std.{functional,getopt,math…
Browse files Browse the repository at this point in the history
…,net,outbuffer}
  • Loading branch information
wilzbach committed May 23, 2019
1 parent 24209a6 commit b56db9a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions std/functional.d
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ Distributed under the Boost Software License, Version 1.0.
*/
module std.functional;

import std.meta; // AliasSeq, Reverse
import std.traits; // isCallable, Parameters
import std.meta : AliasSeq, Reverse;
import std.traits : isCallable, Parameters;


private template needOpCallAlias(alias fun)
Expand Down
6 changes: 4 additions & 2 deletions std/getopt.d
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Distributed under the Boost Software License, Version 1.0.
*/
module std.getopt;

import std.exception; // basicExceptionCtors
import std.exception : basicExceptionCtors;
import std.traits;

/**
Expand Down Expand Up @@ -659,6 +659,7 @@ private template optionValidator(A...)

@system unittest // bugzilla 15914
{
import std.exception : assertThrown;
bool opt;
string[] args = ["program", "-a"];
getopt(args, config.passThrough, 'a', &opt);
Expand Down Expand Up @@ -1743,7 +1744,8 @@ void defaultGetoptFormatter(Output)(Output output, string text, Option[] opt)
// throw on duplicate options
@system unittest
{
import core.exception;
import core.exception : AssertError;
import std.exception : assertNotThrown, assertThrown;
auto args = ["prog", "--abc", "1"];
int abc, def;
assertThrown!AssertError(getopt(args, "abc", &abc, "abc", &abc));
Expand Down
3 changes: 2 additions & 1 deletion std/math.d
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ version (Win64)
static import core.math;
static import core.stdc.math;
static import core.stdc.fenv;
import std.traits; // CommonType, isFloatingPoint, isIntegral, isSigned, isUnsigned, Largest, Unqual
import std.traits : CommonType, isFloatingPoint, isIntegral, isNumeric,
isSigned, isUnsigned, Largest, Unqual;

version (LDC)
{
Expand Down
3 changes: 1 addition & 2 deletions std/net/isemail.d
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
*/
module std.net.isemail;

// FIXME
import std.range.primitives; // : ElementType;
import std.range.primitives : back, front, ElementType, popFront, popBack;
import std.traits;
import std.typecons : Flag, Yes, No;

Expand Down
2 changes: 1 addition & 1 deletion std/outbuffer.d
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Serialize data to `ubyte` arrays.
*/
module std.outbuffer;

import core.stdc.stdarg; // : va_list;
import core.stdc.stdarg;

/*********************************************
* OutBuffer provides a way to build up an array of bytes out
Expand Down

0 comments on commit b56db9a

Please sign in to comment.