Netwave
Netwave

Reputation: 42678

How to force --document-private-items from Cargo.toml?

Is there a way of forcing private items documentation on docs build?

It can be done manually adding the doc flag --document-private-items, but I would like to force it in Cargo.toml level for example.

Upvotes: 3

Views: 246

Answers (1)

Aleksander Krauze
Aleksander Krauze

Reputation: 6061

You can do this not with Cargo.toml but cargo's config. In your project (or in $CARGO_HOME if you want this to apply for all of your projects) create .cargo/config.toml with following contents:

[build]
rustdocflags = ["--document-private-items"]

Here is the link to the documentation.

Upvotes: 4

Related Questions