aboutsummaryrefslogtreecommitdiff
path: root/libphobos/src/std/file.d
diff options
context:
space:
mode:
Diffstat (limited to 'libphobos/src/std/file.d')
-rw-r--r--libphobos/src/std/file.d13
1 files changed, 6 insertions, 7 deletions
diff --git a/libphobos/src/std/file.d b/libphobos/src/std/file.d
index 8d1b431..d031096 100644
--- a/libphobos/src/std/file.d
+++ b/libphobos/src/std/file.d
@@ -4986,21 +4986,20 @@ auto dirEntries(bool useDIP1000 = dip1000Enabled)
{
string[] listdir(string pathname)
{
- import std.algorithm;
- import std.array;
- import std.file;
- import std.path;
+ import std.algorithm.iteration : map, filter;
+ import std.array : array;
+ import std.path : baseName;
- return std.file.dirEntries(pathname, SpanMode.shallow)
+ return dirEntries(pathname, SpanMode.shallow)
.filter!(a => a.isFile)
- .map!((return a) => std.path.baseName(a.name))
+ .map!((return a) => baseName(a.name))
.array;
}
// Can be safe only with -preview=dip1000
@safe void main(string[] args)
{
- import std.stdio;
+ import std.stdio : writefln;
string[] files = listdir(args[1]);
writefln("%s", files);