rustdoc versus Cargo

As with the other operations provided by Cargo, when documentation is created, it acts as a wrapper for rustdoc. The only difference is that with rustdoc you have to specify the directory that the source file sits in. Cargo acts dumb in this case, and creates the documentation for all source files.

In its simplest form, the rustdoc command is used as follows:

cargo doc
rustdoc src/main.rs  

Cargo does have the advantage of creating the doc structure within the root folder, whereas rustdoc creates the structure within the target (which is removed with cargo clean).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset