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

Docs suggests document-features as an optional feature #7

Closed
emilk opened this issue Jun 9, 2022 · 2 comments
Closed

Docs suggests document-features as an optional feature #7

emilk opened this issue Jun 9, 2022 · 2 comments

Comments

@emilk
Copy link

emilk commented Jun 9, 2022

Hi, and thanks for a great crate!

The docs suggests adding this to your Cargo.toml:

## Enable this when building the docs
document-features = { version = "0.2", optional = true }

The problem with this is that it breaks cargo check:

7 | #![doc = document_features::document_features!()]
  |          ^^^^^^^^^^^^^^^^^ use of undeclared crate or module `document_features`

I would suggest updating the docs to instead just have

document-features = "0.2"

unless there is some way to get around the cargo check issue that I'm not aware of

@ogoffart
Copy link
Member

ogoffart commented Jun 9, 2022

The docs suggest also to use cfg_attr in that case.

You could use

#![cfg_attr(feature = "document-features", doc = document_features::document_features!())]

If you think the docs are not clear enough feel free to make a suggestion :-)

@emilk
Copy link
Author

emilk commented Jun 10, 2022

Ah, I didn't read the far, just copy-pasted the first thing I saw :P

I made a PR where I suggest we always use the more verbose #![cfg_attr(feature = "document-features", doc = document_features::document_features!())]

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

Successfully merging a pull request may close this issue.

2 participants