From 779d740a42346d6da316c2e3dcc85feb6549c363 Mon Sep 17 00:00:00 2001 From: finga Date: Mon, 11 Oct 2021 15:05:42 +0200 Subject: [PATCH] Improve wordings and small additions --- rust-intro.org | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/rust-intro.org b/rust-intro.org index fe2d2aa..2d62d94 100644 --- a/rust-intro.org +++ b/rust-intro.org @@ -100,7 +100,7 @@ ** Where to share, find help and stay up to date *** Online sharing/testing - [[https://play.rust-lang.org/][play.rust-lang.org]] - - [[https://godbolt.org/][godbolt.org]] (Not only Rust is supported) + - [[https://godbolt.org/][godbolt.org]] (Supports not only Rust) *** Chat (Discord) - [[https://discord.gg/rust-lang][The Rust Programming Language]] @@ -426,6 +426,29 @@ - Build chain/tool - Cargo calls ~rustc~, the Rust compiler - A Cargo project contains at least one crate + - Custom build scripts with ~build.rs~ + - Builds just work + +** Cargo commands +*** Create a new binary crate (~init~ does so in an existing directory) + #+BEGIN_SRC sh + $ cargo new [--bin] + #+END_SRC + +*** Create a new library crate (~init~ does so in an existing directory) + #+BEGIN_SRC sh + $ cargo new --lib + #+END_SRC + +*** Update build dependencies + #+BEGIN_SRC sh + $ cargo update + #+END_SRC + +*** Install crates + #+BEGIN_SRC sh + $ cargo install [crate] + #+END_SRC ** Hello, World Executing ~`cargo new foobar`~ creates a new project... @@ -455,6 +478,7 @@ #+END_SRC ** Docs + - Cargo help: ~cargo --help~ and ~cargo [SUBCOMMAND] --help~ - [[https://doc.rust-lang.org/cargo/index.html][The Cargo Book]] (~$ rustup docs --cargo~) - Guillaume Gomez: [[https://blog.guillaume-gomez.fr/articles/2020-03-12+Guide+on+how+to+write+documentation+for+a+Rust+crate][Guide on how to write documentation for a Rust crate]] @@ -474,8 +498,8 @@ *** @@comment: comment@@ Cargo downloads your Rust package's dependencies, compiles your - package, makes distributable packages, and uploads them to - [[https://crates.io][crates.io]], the Rust community's package registry. + package, makes distributable packages, and is able to upload them + to [[https://crates.io][crates.io]], the Rust community's package registry. ** The Rust (package) registry