Repository: pyrossh/rust-embed (language: rust)

Issue:
Missing documentation for macro generated code
Hey!

Most of my crates have the following instruction in `lib.rs`:

```rs
#![warn(missing_docs)]
```

And due to this I'm getting a warning when I'm using `rust-embed`:

```
warning: missing documentation for an associated function
  --> git-cliff-core/src/embed.rs:14:17
   |
14 | #[derive(Debug, RustEmbed)]
   |                 ^^^^^^^^^
   |
note: the lint level is defined here
  --> git-cliff-core/src/lib.rs:2:9
   |
2  | #![warn(missing_docs, clippy::unwrap_used)]
   |         ^^^^^^^^^^^^
   = note: this warning originates in the derive macro `RustEmbed` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: missing documentation for an associated function
  --> git-cliff-core/src/embed.rs:14:17
   |
14 | #[derive(Debug, RustEmbed)]
   |                 ^^^^^^^^^
   |
   = note: this warning originates in the derive macro `RustEmbed` (in Nightly builds, run with -Z macro-backtrace for more info)
```

So can we add (at least 1 line of) doc comments to macro generated functions? (`get` and `iter`) I think this would be good to have in case other people might face the same issue in the future.

What do you think? I'd like to provide a PR about this.


Discussion / hints:
Sounds good to me. Sure you can raise a PR for it.

Fix patch:
diff --git a/impl/src/lib.rs b/impl/src/lib.rs
index 94c0846..43a555e 100644
--- a/impl/src/lib.rs
+++ b/impl/src/lib.rs
@@ -46,6 +46,7 @@ fn embedded(ident: &syn::Ident, folder_path: String, prefix: Option<&str>) -> To
   quote! {
       #not_debug_attr
       impl #ident {
+          /// Get an embedded file and its metadata.
           pub fn get(file_path: &str) -> Option<rust_embed::EmbeddedFile> {
             #handle_prefix
             match file_path.replace("\\", "/").as_str() {
@@ -59,6 +60,7 @@ fn embedded(ident: &syn::Ident, folder_path: String, prefix: Option<&str>) -> To
               items.iter()
           }
 
+          /// Iterates over the file paths in the folder.
           pub fn iter() -> impl Iterator<Item = std::borrow::Cow<'static, str>> {
               Self::names().map(|x| std::borrow::Cow::from(*x))
           }
@@ -89,6 +91,7 @@ fn dynamic(ident: &syn::Ident, folder_path: String, prefix: Option<&str>) -> Tok
   quote! {
       #[cfg(debug_assertions)]
       impl #ident {
+          /// Get an embedded file and its metadata.
           pub fn get(file_path: &str) -> Option<rust_embed::EmbeddedFile> {
               #handle_prefix
 
@@ -96,6 +99,7 @@ fn dynamic(ident: &syn::Ident, folder_path: String, prefix: Option<&str>) -> Tok
               rust_embed::utils::read_file_from_fs(&file_path).ok()
           }
 
+          /// Iterates over the file paths in the folder.
           pub fn iter() -> impl Iterator<Item = std::borrow::Cow<'static, str>> {
               use std::path::Path;
               rust_embed::utils::get_files(String::from(#folder_path))


Test patch: