Cargo is the rust package manager. It has a bunch of default settings, but those are silly. Using the path field in lib and bin we can override the siliest ones.


name = "swagger_to_md"
version = "1.0.0"
description = "Transform swagger to markdown"
keywords = ["swagger","markdown","transform","md","compile","html"]

name = "swagger_to_md"
path = ""

name = "swagger-to-md"
path = "bin/"



Libs are libraries. All it needs to do is expose a bunch of functions.


bin can have multiple multiple exports. Each command must reference a path and have an export name. Each file must expose a main function.

Pinning versions

To pin versions in Cargo.toml the cargo-edit command must be exposed to add cargo add. This pulls the latest version of a dep from and stores it in Cargo.toml.

Dont't touch the network

$ cargo run --frozen

Install latest cargo version

$ rustup override set nightly

Use last known good cargo version

$ rustup override set $(<rustc-version)

Incremental compilation

$ CARGO_INCREMENTAL=1 cargo <command>
$ rustc -Zincremental=<path> <other arguments>

See Also

results matching ""

    No results matching ""