Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warning: needless fn main in doctest #5

Open
szabgab opened this issue Nov 15, 2023 · 1 comment
Open

warning: needless fn main in doctest #5

szabgab opened this issue Nov 15, 2023 · 1 comment

Comments

@szabgab
Copy link

szabgab commented Nov 15, 2023

I ran cargo clippy in the repo and got this report:

    Checking fomat-macros v0.3.2 (/home/gabor/os/fomat-macros)
warning: needless `fn main` in doctest
  --> src/lib.rs:23:4
   |
23 | //! use fomat_macros::pintln;
   |    ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_doctest_main
   = note: `#[warn(clippy::needless_doctest_main)]` on by default

warning: `fomat-macros` (lib) generated 1 warning
    Finished dev [unoptimized + debuginfo] target(s) in 0.08s

Is it maybe because of a missing # on line 25 in front of the fn main?

@szabgab
Copy link
Author

szabgab commented Nov 15, 2023

Trying to understand the source of this, I actually like the fact that we can see the full example on the docs site, including the fn main part.

szabgab added a commit to szabgab/fomat-macros that referenced this issue Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant