Sort imports
This commit is contained in:
parent
a576c36d02
commit
74b085b88d
@ -74,7 +74,7 @@ lambda_return_check="skip-unittest"
|
||||
; Check for auto function without return statement
|
||||
auto_function_check="skip-unittest"
|
||||
; Check for sortedness of imports
|
||||
imports_sortedness="disabled"
|
||||
imports_sortedness="skip-unittest"
|
||||
; Check for explicitly annotated unittests
|
||||
explicitly_annotated_unittests="disabled"
|
||||
; Check for useless usage of the final attribute
|
||||
|
@ -19,20 +19,20 @@ version (D_Ddoc)
|
||||
}
|
||||
else version (linux):
|
||||
|
||||
import core.stdc.errno;
|
||||
public import core.sys.linux.epoll;
|
||||
import tanya.async.protocol;
|
||||
import core.sys.posix.unistd;
|
||||
import core.time;
|
||||
import std.algorithm.comparison;
|
||||
import tanya.async.event.selector;
|
||||
import tanya.async.loop;
|
||||
import tanya.async.protocol;
|
||||
import tanya.async.transport;
|
||||
import tanya.async.watcher;
|
||||
import tanya.container.array;
|
||||
import tanya.memory;
|
||||
import tanya.memory.mmappool;
|
||||
import tanya.network.socket;
|
||||
import core.stdc.errno;
|
||||
import core.sys.posix.unistd;
|
||||
import core.time;
|
||||
import std.algorithm.comparison;
|
||||
|
||||
extern (C) nothrow @nogc
|
||||
{
|
||||
|
@ -19,17 +19,17 @@ version (D_Ddoc)
|
||||
}
|
||||
else version (Windows):
|
||||
|
||||
import tanya.container.buffer;
|
||||
import core.sys.windows.mswsock;
|
||||
import core.sys.windows.winsock2;
|
||||
import tanya.async.loop;
|
||||
import tanya.async.protocol;
|
||||
import tanya.async.transport;
|
||||
import tanya.async.watcher;
|
||||
import tanya.container.buffer;
|
||||
import tanya.memory;
|
||||
import tanya.memory.mmappool;
|
||||
import tanya.network.socket;
|
||||
import tanya.sys.windows.winbase;
|
||||
import core.sys.windows.mswsock;
|
||||
import core.sys.windows.winsock2;
|
||||
|
||||
/**
|
||||
* Transport for stream sockets.
|
||||
|
@ -23,8 +23,8 @@ import tanya.async.loop;
|
||||
import tanya.async.protocol;
|
||||
import tanya.async.transport;
|
||||
import tanya.async.watcher;
|
||||
import tanya.container.buffer;
|
||||
import tanya.container.array;
|
||||
import tanya.container.buffer;
|
||||
import tanya.memory;
|
||||
import tanya.memory.mmappool;
|
||||
import tanya.network.socket;
|
||||
|
@ -18,8 +18,8 @@
|
||||
*/
|
||||
module tanya.async.protocol;
|
||||
|
||||
import tanya.network.socket;
|
||||
import tanya.async.transport;
|
||||
import tanya.network.socket;
|
||||
|
||||
/**
|
||||
* Common protocol interface.
|
||||
|
@ -14,8 +14,8 @@
|
||||
*/
|
||||
module tanya.async.watcher;
|
||||
|
||||
import std.functional;
|
||||
import std.exception;
|
||||
import std.functional;
|
||||
import tanya.async.loop;
|
||||
import tanya.async.protocol;
|
||||
import tanya.async.transport;
|
||||
|
@ -16,10 +16,10 @@ module tanya.container;
|
||||
|
||||
public import tanya.container.array;
|
||||
public import tanya.container.buffer;
|
||||
public import tanya.container.set;
|
||||
public import tanya.container.list;
|
||||
public import tanya.container.string;
|
||||
public import tanya.container.queue;
|
||||
public import tanya.container.set;
|
||||
public import tanya.container.string;
|
||||
|
||||
/**
|
||||
* Thrown if $(D_PSYMBOL Set) cannot insert a new element because the container
|
||||
|
@ -201,7 +201,7 @@ struct Queue(T)
|
||||
{
|
||||
int result;
|
||||
|
||||
for (size_t i = 0; !empty; ++i)
|
||||
for (size_t i; !empty; ++i)
|
||||
{
|
||||
auto e = dequeue();
|
||||
if ((result = dg(i, e)) != 0)
|
||||
|
@ -437,7 +437,7 @@ struct Set(T)
|
||||
InsertStatus status = insertInUnusedBucket(value);
|
||||
for (; !status; status = insertInUnusedBucket(value))
|
||||
{
|
||||
if ((this.primes.length - 1) == this.lengthIndex)
|
||||
if (this.primes.length == (this.lengthIndex + 1))
|
||||
{
|
||||
throw make!HashContainerFullException(defaultAllocator,
|
||||
"Set is full");
|
||||
|
@ -30,8 +30,7 @@ import core.exception;
|
||||
import std.algorithm.comparison;
|
||||
import std.algorithm.mutation;
|
||||
import std.algorithm.searching;
|
||||
import std.range : isInfinite, isInputRange, ElementEncodingType, hasLength,
|
||||
popFrontN, empty;
|
||||
static import std.range;
|
||||
import tanya.memory;
|
||||
import tanya.meta.trait;
|
||||
import tanya.meta.transform;
|
||||
@ -353,9 +352,9 @@ struct String
|
||||
* Precondition: $(D_INLINECODE allocator is null).
|
||||
*/
|
||||
this(S)(const S str, shared Allocator allocator = defaultAllocator)
|
||||
if (!isInfinite!S
|
||||
&& isInputRange!S
|
||||
&& isSomeChar!(ElementEncodingType!S))
|
||||
if (!std.range.isInfinite!S
|
||||
&& std.range.isInputRange!S
|
||||
&& isSomeChar!(std.range.ElementEncodingType!S))
|
||||
{
|
||||
this(allocator);
|
||||
insertBack(str);
|
||||
@ -668,12 +667,12 @@ struct String
|
||||
* Throws: $(D_PSYMBOL UTFException).
|
||||
*/
|
||||
size_t insertBack(R)(R str) @trusted
|
||||
if (!isInfinite!R
|
||||
&& isInputRange!R
|
||||
&& is(Unqual!(ElementEncodingType!R) == char))
|
||||
if (!std.range.isInfinite!R
|
||||
&& std.range.isInputRange!R
|
||||
&& is(Unqual!(std.range.ElementEncodingType!R) == char))
|
||||
{
|
||||
size_t size;
|
||||
static if (hasLength!R || isNarrowString!R)
|
||||
static if (std.range.hasLength!R || isNarrowString!R)
|
||||
{
|
||||
size = str.length + length;
|
||||
reserve(size);
|
||||
@ -732,11 +731,11 @@ struct String
|
||||
|
||||
/// ditto
|
||||
size_t insertBack(R)(R str) @trusted
|
||||
if (!isInfinite!R
|
||||
&& isInputRange!R
|
||||
&& is(Unqual!(ElementEncodingType!R) == wchar))
|
||||
if (!std.range.isInfinite!R
|
||||
&& std.range.isInputRange!R
|
||||
&& is(Unqual!(std.range.ElementEncodingType!R) == wchar))
|
||||
{
|
||||
static if (hasLength!R || isNarrowString!R)
|
||||
static if (std.range.hasLength!R || isNarrowString!R)
|
||||
{
|
||||
reserve(length + str.length * wchar.sizeof);
|
||||
}
|
||||
@ -771,7 +770,7 @@ struct String
|
||||
}
|
||||
dchar d = (range[0] - 0xd800) | ((range[1] - 0xdc00) >> 10);
|
||||
|
||||
range.popFrontN(2);
|
||||
std.range.popFrontN(range, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -798,11 +797,11 @@ struct String
|
||||
|
||||
/// ditto
|
||||
size_t insertBack(R)(R str) @trusted
|
||||
if (!isInfinite!R
|
||||
&& isInputRange!R
|
||||
&& is(Unqual!(ElementEncodingType!R) == dchar))
|
||||
if (!std.range.isInfinite!R
|
||||
&& std.range.isInputRange!R
|
||||
&& is(Unqual!(std.range.ElementEncodingType!R) == dchar))
|
||||
{
|
||||
static if (hasLength!R || isSomeString!R)
|
||||
static if (std.range.hasLength!R || isSomeString!R)
|
||||
{
|
||||
reserve(length + str.length * 4);
|
||||
}
|
||||
@ -1269,9 +1268,9 @@ struct String
|
||||
* Throws: $(D_PSYMBOL UTFException).
|
||||
*/
|
||||
ref String opAssign(S)(S that) nothrow
|
||||
if (!isInfinite!S
|
||||
&& isInputRange!S
|
||||
&& isSomeChar!(ElementEncodingType!S))
|
||||
if (!std.range.isInfinite!S
|
||||
&& std.range.isInputRange!S
|
||||
&& isSomeChar!(std.range.ElementEncodingType!S))
|
||||
{
|
||||
this.length_ = 0;
|
||||
insertBack(that);
|
||||
@ -1507,7 +1506,7 @@ struct String
|
||||
assert(s.length == 38);
|
||||
|
||||
auto byCodePoint = s.byCodePoint();
|
||||
byCodePoint.popFrontN(8);
|
||||
std.range.popFrontN(byCodePoint, 8);
|
||||
|
||||
assert(s.remove(byCodePoint).count == 0);
|
||||
assert(s == "Из слова");
|
||||
@ -1532,9 +1531,9 @@ struct String
|
||||
* Precondition: $(D_PARAM r) refers to a region of $(D_KEYWORD this).
|
||||
*/
|
||||
size_t insertAfter(T, R)(R r, T el) @trusted
|
||||
if ((isSomeChar!T || (!isInfinite!T
|
||||
&& isInputRange!T
|
||||
&& isSomeChar!(ElementEncodingType!T)))
|
||||
if ((isSomeChar!T || (!std.range.isInfinite!T
|
||||
&& std.range.isInputRange!T
|
||||
&& isSomeChar!(std.range.ElementEncodingType!T)))
|
||||
&& (is(R == ByCodeUnit!char) || is(R == ByCodePoint!char)))
|
||||
in
|
||||
{
|
||||
@ -1565,9 +1564,9 @@ struct String
|
||||
|
||||
///
|
||||
size_t insertBefore(T, R)(R r, T el) @trusted
|
||||
if ((isSomeChar!T || (!isInfinite!T
|
||||
&& isInputRange!T
|
||||
&& isSomeChar!(ElementEncodingType!T)))
|
||||
if ((isSomeChar!T || (!std.range.isInfinite!T
|
||||
&& std.range.isInputRange!T
|
||||
&& isSomeChar!(std.range.ElementEncodingType!T)))
|
||||
&& (is(R == ByCodeUnit!char) || is(R == ByCodePoint!char)))
|
||||
in
|
||||
{
|
||||
|
@ -300,7 +300,7 @@ class Entropy
|
||||
// Perform second SHA-512 on entropy
|
||||
output = sha512Of(output);
|
||||
|
||||
for (ubyte i = 0; i < sourceCount; ++i)
|
||||
for (ubyte i; i < sourceCount; ++i)
|
||||
{
|
||||
sources[i].size = 0;
|
||||
}
|
||||
|
@ -20,8 +20,11 @@ import tanya.memory.op;
|
||||
|
||||
version (Posix)
|
||||
{
|
||||
import core.sys.posix.sys.mman : PROT_READ, PROT_WRITE, MAP_PRIVATE,
|
||||
MAP_ANON, MAP_FAILED;
|
||||
import core.sys.posix.sys.mman : MAP_ANON,
|
||||
MAP_FAILED,
|
||||
MAP_PRIVATE,
|
||||
PROT_READ,
|
||||
PROT_WRITE;
|
||||
import core.sys.posix.unistd;
|
||||
|
||||
extern(C)
|
||||
|
@ -20,8 +20,8 @@ import std.algorithm.mutation;
|
||||
import std.conv;
|
||||
public import tanya.memory.allocator;
|
||||
import tanya.memory.mmappool;
|
||||
import tanya.range.primitive;
|
||||
import tanya.meta.trait;
|
||||
import tanya.range.primitive;
|
||||
|
||||
/**
|
||||
* The mixin generates common methods for classes and structs using
|
||||
|
@ -19,6 +19,7 @@
|
||||
module tanya.meta.metafunction;
|
||||
|
||||
import tanya.meta.trait;
|
||||
import tanya.meta.transform;
|
||||
|
||||
/**
|
||||
* Finds the minimum value in $(D_PARAM Args) according to $(D_PARAM pred).
|
||||
@ -707,38 +708,6 @@ pure nothrow @safe @nogc unittest
|
||||
static assert(is(Instance2 == float));
|
||||
}
|
||||
|
||||
version (TanyaPhobos)
|
||||
{
|
||||
public import std.meta : Alias,
|
||||
AliasSeq,
|
||||
aliasSeqOf,
|
||||
Erase,
|
||||
EraseAll,
|
||||
Filter,
|
||||
NoDuplicates,
|
||||
DerivedToFront,
|
||||
MostDerived,
|
||||
Repeat,
|
||||
Replace,
|
||||
ReplaceAll,
|
||||
Reverse,
|
||||
Map = staticMap,
|
||||
Sort = staticSort,
|
||||
allSatisfy,
|
||||
anySatisfy,
|
||||
staticIndexOf,
|
||||
templateAnd,
|
||||
templateNot,
|
||||
templateOr,
|
||||
isSorted = staticIsSorted,
|
||||
ApplyLeft,
|
||||
ApplyRight;
|
||||
}
|
||||
else:
|
||||
|
||||
import tanya.meta.trait;
|
||||
import tanya.meta.transform;
|
||||
|
||||
/**
|
||||
* Creates an alias for $(D_PARAM T).
|
||||
*
|
||||
|
@ -360,70 +360,6 @@ pure nothrow @safe @nogc unittest
|
||||
static assert(hasStaticMember!(S, "member5"));
|
||||
}
|
||||
|
||||
version (TanyaPhobos)
|
||||
{
|
||||
public import std.traits : isFloatingPoint,
|
||||
isSigned,
|
||||
isUnsigned,
|
||||
isIntegral,
|
||||
isNumeric,
|
||||
isBoolean,
|
||||
isSomeChar,
|
||||
isScalarType,
|
||||
isBasicType,
|
||||
isPointer,
|
||||
isArray,
|
||||
isStaticArray,
|
||||
isDynamicArray,
|
||||
isAssociativeArray,
|
||||
isBuiltinType,
|
||||
isAggregateType,
|
||||
getUDAs,
|
||||
isNarrowString,
|
||||
isSomeString,
|
||||
mostNegative,
|
||||
Largest,
|
||||
isCopyable,
|
||||
isAbstractClass,
|
||||
isFinalClass,
|
||||
isAbstractFunction,
|
||||
isFinalFunction,
|
||||
isFunctionPointer,
|
||||
isDelegate,
|
||||
isFunction,
|
||||
isSomeFunction,
|
||||
isCallable,
|
||||
hasMember,
|
||||
isMutable,
|
||||
isNested,
|
||||
isNestedFunction,
|
||||
mangledName,
|
||||
isInstanceOf,
|
||||
isImplicitlyConvertible,
|
||||
BaseTypeTuple,
|
||||
TransitiveBaseTypeTuple,
|
||||
BaseClassesTuple,
|
||||
InterfacesTuple,
|
||||
isAssignable,
|
||||
TemplateArgsOf,
|
||||
Parameters,
|
||||
ParameterIdentifierTuple,
|
||||
functionAttributes,
|
||||
ParameterDefaults,
|
||||
hasElaborateDestructor,
|
||||
hasElaborateCopyConstructor,
|
||||
hasElaborateAssign,
|
||||
EnumMembers,
|
||||
classInstanceAlignment,
|
||||
ifTestable,
|
||||
FunctionTypeOf,
|
||||
ReturnType,
|
||||
TemplateOf,
|
||||
isTypeTuple,
|
||||
isExpressions;
|
||||
}
|
||||
else:
|
||||
|
||||
/**
|
||||
* Determines whether $(D_PARAM T) is a floating point type.
|
||||
*
|
||||
@ -1269,10 +1205,20 @@ pure nothrow @safe @nogc unittest
|
||||
static assert(!isTypeTuple!(int, 8, Object));
|
||||
static assert(!isTypeTuple!(5, 8, 2));
|
||||
|
||||
class C;
|
||||
enum E : bool;
|
||||
union U;
|
||||
struct T();
|
||||
class C
|
||||
{
|
||||
}
|
||||
enum E : bool
|
||||
{
|
||||
t,
|
||||
f,
|
||||
}
|
||||
union U
|
||||
{
|
||||
}
|
||||
struct T()
|
||||
{
|
||||
}
|
||||
|
||||
static assert(isTypeTuple!C);
|
||||
static assert(isTypeTuple!E);
|
||||
@ -2392,7 +2338,7 @@ if (isCallable!F)
|
||||
{
|
||||
static if (is(FunctionTypeOf!F Params == __parameters))
|
||||
{
|
||||
enum string[] Impl()
|
||||
string[] Impl()
|
||||
{
|
||||
string[] tuple;
|
||||
|
||||
@ -2463,7 +2409,7 @@ enum FunctionAttribute : uint
|
||||
template functionAttributes(F...)
|
||||
if (isCallable!F)
|
||||
{
|
||||
enum uint Impl()
|
||||
uint Impl()
|
||||
{
|
||||
uint attrs = FunctionAttribute.none;
|
||||
foreach (a; __traits(getFunctionAttributes, F[0]))
|
||||
|
@ -18,28 +18,6 @@
|
||||
*/
|
||||
module tanya.meta.transform;
|
||||
|
||||
version (TanyaPhobos)
|
||||
{
|
||||
public import std.traits : Unqual,
|
||||
OriginalType,
|
||||
CopyConstness,
|
||||
CopyTypeQualifiers,
|
||||
Unsigned,
|
||||
Signed,
|
||||
PointerTarget,
|
||||
KeyType,
|
||||
ValueType,
|
||||
Promoted,
|
||||
InoutOf,
|
||||
ConstOf,
|
||||
SharedOf,
|
||||
SharedInoutOf,
|
||||
SharedConstOf,
|
||||
ImmutableOf,
|
||||
QualifierOf;
|
||||
}
|
||||
else:
|
||||
|
||||
import tanya.meta.trait;
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@ module tanya.network.socket;
|
||||
import core.stdc.errno;
|
||||
import core.time;
|
||||
import std.algorithm.comparison;
|
||||
public import std.socket : SocketOptionLevel, SocketOption;
|
||||
public import std.socket : SocketOption, SocketOptionLevel;
|
||||
import std.traits;
|
||||
import std.typecons;
|
||||
import tanya.memory;
|
||||
@ -44,50 +44,50 @@ version (Posix)
|
||||
}
|
||||
else version (Windows)
|
||||
{
|
||||
import core.sys.windows.winbase : GetModuleHandle,
|
||||
GetProcAddress,
|
||||
import core.sys.windows.winbase : ERROR_IO_INCOMPLETE,
|
||||
ERROR_IO_PENDING,
|
||||
ERROR_IO_INCOMPLETE;
|
||||
import core.sys.windows.winsock2 : sockaddr,
|
||||
GetModuleHandle,
|
||||
GetProcAddress;
|
||||
import core.sys.windows.winsock2 : accept,
|
||||
addrinfo,
|
||||
bind,
|
||||
closesocket,
|
||||
FIONBIO,
|
||||
freeaddrinfo,
|
||||
getaddrinfo,
|
||||
SD_RECEIVE,
|
||||
SD_SEND,
|
||||
SD_BOTH,
|
||||
getsockopt,
|
||||
ioctlsocket,
|
||||
listen,
|
||||
MSG_DONTROUTE,
|
||||
MSG_OOB,
|
||||
MSG_PEEK,
|
||||
MSG_DONTROUTE,
|
||||
socklen_t,
|
||||
recv,
|
||||
SD_BOTH,
|
||||
SD_RECEIVE,
|
||||
SD_SEND,
|
||||
send,
|
||||
setsockopt,
|
||||
shutdown,
|
||||
SOCKADDR,
|
||||
SOCKADDR_STORAGE,
|
||||
addrinfo,
|
||||
sockaddr,
|
||||
sockaddr_in,
|
||||
sockaddr_in6,
|
||||
shutdown,
|
||||
closesocket,
|
||||
listen,
|
||||
SOCKADDR_STORAGE,
|
||||
socket,
|
||||
bind,
|
||||
accept,
|
||||
WSAGetLastError,
|
||||
recv,
|
||||
send,
|
||||
getsockopt,
|
||||
setsockopt,
|
||||
ioctlsocket,
|
||||
FIONBIO,
|
||||
socklen_t,
|
||||
SOL_SOCKET,
|
||||
SO_TYPE;
|
||||
SO_TYPE,
|
||||
WSAGetLastError;
|
||||
import tanya.async.iocp;
|
||||
import tanya.sys.windows.error : EWOULDBLOCK = WSAEWOULDBLOCK,
|
||||
ECONNABORTED = WSAECONNABORTED,
|
||||
import tanya.sys.windows.def;
|
||||
import tanya.sys.windows.error : ECONNABORTED = WSAECONNABORTED,
|
||||
ENOBUFS = WSAENOBUFS,
|
||||
EOPNOTSUPP = WSAEOPNOTSUPP,
|
||||
EPROTONOSUPPORT = WSAEPROTONOSUPPORT,
|
||||
EPROTOTYPE = WSAEPROTOTYPE,
|
||||
ESOCKTNOSUPPORT = WSAESOCKTNOSUPPORT,
|
||||
ETIMEDOUT = WSAETIMEDOUT,
|
||||
ESOCKTNOSUPPORT = WSAESOCKTNOSUPPORT;
|
||||
import tanya.sys.windows.def;
|
||||
EWOULDBLOCK = WSAEWOULDBLOCK;
|
||||
public import tanya.sys.windows.winbase;
|
||||
public import tanya.sys.windows.winsock2;
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
module tanya.range.primitive;
|
||||
|
||||
import tanya.meta.trait;
|
||||
import tanya.meta.transform;
|
||||
|
||||
/**
|
||||
* Returns the element type of the range $(D_PARAM R).
|
||||
@ -287,18 +288,6 @@ pure nothrow @safe @nogc unittest
|
||||
static assert(hasSlicing!D);
|
||||
}
|
||||
|
||||
version (TanyaPhobos)
|
||||
{
|
||||
public import std.range.primitives : isInputRange,
|
||||
isForwardRange,
|
||||
isBidirectionalRange,
|
||||
isRandomAccessRange,
|
||||
isInfinite;
|
||||
}
|
||||
else:
|
||||
|
||||
import tanya.meta.transform;
|
||||
|
||||
version (unittest)
|
||||
{
|
||||
mixin template InputRangeStub()
|
||||
|
Loading…
Reference in New Issue
Block a user