Closed ModProg closed 2 years ago
The Dir::entries()
getter is const
, so you should already be able to look up files at compile time.
You'd need to write your own recursive search function though. I don't think the existing methods for looking up items (e.g. Dir::get_file()
) can be made const
because they take some S: AsRef<Path>
and traits aren't allowed in const
contexts yet.
Alright, makes sense.
Not sure if this is achievable witht the current architecture, but I would like to be able to query files in
const
. Hopefully this gets done in the need future so I could then also unwrap the resulting file: https://github.com/rust-lang/rust/issues/67441.