mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
lib/std/io: make PathWalker return an optional
Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
This commit is contained in:
committed by
Christoffer Lerno
parent
fc0973f378
commit
e4febe62ef
@@ -407,7 +407,7 @@ fn String Path.root_directory(self)
|
||||
return path_str;
|
||||
}
|
||||
|
||||
def PathWalker = fn bool(Path, bool is_dir, void*);
|
||||
def PathWalker = fn bool! (Path, bool is_dir, void*);
|
||||
|
||||
/*
|
||||
* Walk the path recursively. PathWalker is run on every file and
|
||||
@@ -425,7 +425,7 @@ fn bool! Path.walk(self, PathWalker w, void* data)
|
||||
if (f.as_str() == "." || f.as_str() == "..") continue;
|
||||
f = abs.append(f.as_str(), using)!;
|
||||
bool is_directory = is_dir(f);
|
||||
if (w(f, is_directory, data)) return true;
|
||||
if (w(f, is_directory, data)!) return true;
|
||||
if (is_directory && f.walk(w, data)!) return true;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user