Skip to content

Latest commit

 

History

History
50 lines (37 loc) · 5.18 KB

contributing.md

File metadata and controls

50 lines (37 loc) · 5.18 KB

Contributor Guide

Prepare the development environment

Install the Rust toolchain

Install the Rust toolchain by installing Rustup with the standard and the nightly toolchains.

Setup the Rust toolchain

If you are using a shell capable of running Bash scripts, run the following from the project root directory:

$ ./setup.sh

Otherwise, follow these manual steps:

  1. Install Rustfmt.

  2. Install Clippy.

  3. Install the cargo-deny Cargo plugin.

  4. Install the cargo-udeps Cargo plugin.

  5. If an installation of the pugins cargo-deny, cargo-udeps fails, you may need to install pkg-config, libssl-dev. For example:

    $ sudo apt-get install pkg-config && sudo apt-get install libssl-dev

Build-related commands

This project uses Cargo for build automation.

Run from the project root directory:

# Command Description
0 cargo deny check && cargo +nightly udeps && cargo +nightly clippy --all-targets --all-features && cargo +nightly fmt --check && cargo +nightly test && cargo +nightly doc --no-deps -Zrustdoc-map Analyzes and reports errors, checks style, runs tests.
0.1 cargo +nightly fmt Reformats the code usingrustfmt.
0.2 cargo clean Deletes thetarget directory.
1 cargo +nightly doc --no-deps -Zrustdoc-map --open Generates documentation and opens it in a browser. See https://doc.rust-lang.org/cargo/reference/unstable.html#rustdoc-map .
1.1 cargo clean --doc Deletes the target/doc directory.
2 cargo build Builds the project into thetarget/debug directory using the dev Cargo profile.
3 (cd ./web-server-from-the-book && exec cargo run) Runs web-server-from-the-book, builds the crate if necessary. cargo run -p web-server-from-the-book could have been used alternatively, but it does not change the working directory, which is necessary in this particular case.