mirror of
https://github.com/chubin/cheat.sheets
synced 2024-11-19 03:25:44 +00:00
Merge pull request #65 from sullivant/master
synced cargo and _rust/Cargo
This commit is contained in:
commit
a0b2c9e20c
@ -1,18 +1,30 @@
|
|||||||
// Using the Cargo package manager
|
# Cargo is the Rust package manager
|
||||||
// See also: https://doc.rust-lang.org/cargo/
|
# Cargo downloads your Rust project's dependencies,
|
||||||
|
# compiles your project, makes packages, and upload them to crates.io
|
||||||
|
# See also: https://doc.rust-lang.org/cargo/
|
||||||
|
|
||||||
// Create a new package with Cargo
|
# To start a new project
|
||||||
cargo new hello_world
|
cargo new hello_world --bin # program
|
||||||
|
cargo new hello_world --lib # library
|
||||||
|
|
||||||
// Build a package with Cargo
|
# Build a project without optimizations (in debug mode)
|
||||||
cargo build
|
cargo build
|
||||||
|
|
||||||
// Build and run a package with Cargo
|
# Build a project with optimizations turned on
|
||||||
cargo run
|
|
||||||
|
|
||||||
// Build a package with Cargo for release
|
|
||||||
cargo build --release
|
cargo build --release
|
||||||
|
|
||||||
// Clean all output build files and targets
|
# Build and run (without optimizations) a package with Cargo
|
||||||
|
cargo run
|
||||||
|
|
||||||
|
# Updates dependencies in Cargo.lock
|
||||||
|
cargo update # update all
|
||||||
|
cargo update -p rand # updates just “rand” crate
|
||||||
|
|
||||||
|
# run the project tests (from src/ and tests/)
|
||||||
|
cargo test
|
||||||
|
|
||||||
|
# Clean all output build files and targets
|
||||||
cargo clean
|
cargo clean
|
||||||
|
|
||||||
|
# search for a package
|
||||||
|
cargo search
|
||||||
|
11
sheets/cargo
11
sheets/cargo
@ -1,23 +1,30 @@
|
|||||||
# Cargo is the Rust package manager
|
# Cargo is the Rust package manager
|
||||||
# Cargo downloads your Rust project's dependencies,
|
# Cargo downloads your Rust project's dependencies,
|
||||||
# compiles your project, makes packages, and upload them to crates.io
|
# compiles your project, makes packages, and upload them to crates.io
|
||||||
|
# See also: https://doc.rust-lang.org/cargo/
|
||||||
|
|
||||||
# To start a new project
|
# To start a new project
|
||||||
cargo new hello_world --bin # program
|
cargo new hello_world --bin # program
|
||||||
cargo new hello_world --lib # library
|
cargo new hello_world --lib # library
|
||||||
|
|
||||||
# Build a project
|
# Build a project without optimizations (in debug mode)
|
||||||
cargo build
|
cargo build
|
||||||
|
|
||||||
# Build a project with optimizations turned on
|
# Build a project with optimizations turned on
|
||||||
cargo build --release
|
cargo build --release
|
||||||
|
|
||||||
|
# Build and run (without optimizations) a package with Cargo
|
||||||
|
cargo run
|
||||||
|
|
||||||
# Updates dependencies in Cargo.lock
|
# Updates dependencies in Cargo.lock
|
||||||
cargo update # update all
|
cargo update # update all
|
||||||
cargo update -p rand # updates just “rand”
|
cargo update -p rand # updates just “rand” crate
|
||||||
|
|
||||||
# run the project tests (from src/ and tests/)
|
# run the project tests (from src/ and tests/)
|
||||||
cargo test
|
cargo test
|
||||||
|
|
||||||
|
# Clean all output build files and targets
|
||||||
|
cargo clean
|
||||||
|
|
||||||
# search for a package
|
# search for a package
|
||||||
cargo search
|
cargo search
|
||||||
|
Loading…
Reference in New Issue
Block a user