Closed jbr closed 2 years ago
Can you give me a good example of where you might need this?
My opinion is that you should have access to all required directories at compile time, so if you are trying to embed a directory that doesn't exist it should be a compile error. There is no try_include_str!()
macro in std
, for instance.
Currently,
include_dir::include_dir
panics if the directory does not exist, which makes it difficult to use in library code that can't guarantee the existence of a particular root directory.include_dir::try_include_dir
introduces a way to attempt to include a directory but compile in a Result::Err literal instead of the directory, allowing library code to use this in a macro and gracefully handle the scenario where the directory is missing.