Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 850
Netwave Avatar asked Jan 23 '26 04:01

Netwave


1 Answers

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.

like image 80
Aleksander Krauze Avatar answered Jan 25 '26 18:01

Aleksander Krauze



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!