diff --git a/embed/src/dir.rs b/embed/src/dir.rs index 231902d..0bc81a1 100644 --- a/embed/src/dir.rs +++ b/embed/src/dir.rs @@ -61,7 +61,8 @@ fn read_dir(path: &PathBuf) -> Vec { entries } -pub fn __include_dir(caller: &str, path: &str) -> Dir { +#[doc(hidden)] +pub fn __include_dir_runtime(caller: &str, path: &str) -> Dir { let path = PathBuf::from(caller) .parent() .expect("Failed to get the parent of file") @@ -77,11 +78,11 @@ macro_rules! dir { ($path:literal) => {{ #[cfg(debug_assertions)] { - ::embed::__include_dir(file!(), $path) + ::embed::__include_dir_runtime(file!(), $path) } #[cfg(not(debug_assertions))] { - ::embed_macros::__include_dir!($path) + ::embed::__include_dir!($path) } }}; } diff --git a/embed/src/lib.rs b/embed/src/lib.rs index cda98b3..c880421 100644 --- a/embed/src/lib.rs +++ b/embed/src/lib.rs @@ -2,3 +2,6 @@ mod dir; pub use dir::*; mod file; + +#[doc(hidden)] +pub use embed_macros::__include_dir; diff --git a/macros/src/lib.rs b/macros/src/lib.rs index 4f26371..a00ddd0 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -14,6 +14,7 @@ use syn::{ LitStr, }; +#[doc(hidden)] #[proc_macro] pub fn __include_dir(input: pm1::TokenStream) -> pm1::TokenStream { let caller = TokenStream::from(input).span().source_file().path();