I like how include_str!(..) works. Is there a macro that simply checks if the file exists instead of loading the contents of the file?
Use case? I want to make sure that all the file paths that are valid before I release it, to prevent runtime error.
So the file path has to be checked even if the macro isn't called during runtime.
OR should I be using tests here?
This will do for now.
#[macro_export]
macro_rules! find_file{
($arg1:literal) => {
{
//opportunity for improvement
let _ = include_bytes!($arg1);
let r = $arg1;
r
}
};
}
@PitaJ thanks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With