Go to file
Chris Krycho d207d894cc
Merge pull request #3898 from rust-lang/chriskrycho/crab-pincers
Ch. 2: intentionally use `{}` at first
2024-04-19 13:48:19 -06:00
.cargo Set cargo new config vars to placeholders for example projects 2020-01-20 15:39:50 -05:00
.github Update to Rust 1.76 2024-02-19 15:39:35 -05:00
2018-edition Remove 2018 edition theme. 2022-08-16 18:47:18 -07:00
ci Add a rustc hash to spellcheck dictionary 2024-02-19 15:39:35 -05:00
dot Fix #1855 - incorporate new reference cycle diagram 2020-12-09 21:30:50 -05:00
first-edition Remove unused theme directories. 2022-07-11 11:16:11 -04:00
listings Ch. 2: intentionally use `{}` at first 2024-04-19 13:42:05 -06:00
nostarch Fix a problem with literal style ending 2022-10-20 16:39:55 -04:00
redirects Inline fmt lints for `redirects/` 2024-04-19 15:40:41 -04:00
second-edition Remove unused theme directories. 2022-07-11 11:16:11 -04:00
src Merge pull request #3287 from bravequickcleverfibreyarn/listing-12-02 2024-04-19 13:36:49 -06:00
theme move the book to the top level 2018-11-20 13:45:05 -05:00
tools Apply clippy::uninlined_format_args fix 2024-04-19 15:20:22 -04:00
.gitattributes Mark png as binary 2017-03-31 15:30:48 -04:00
.gitignore
ADMIN_TASKS.md Update instructions on docx -> md now that I've done it again 2022-10-20 16:39:55 -04:00
CONTRIBUTING.md Fix mdBook links 2023-11-09 09:49:16 -05:00
COPYRIGHT simplify COPYRIGHT file 2023-03-30 09:59:46 -04:00
Cargo.lock Update syn dependencies in Chapter 19 to 2.0 2024-04-15 11:24:35 -07:00
Cargo.toml Inline all format arguments 2023-10-30 11:54:36 -04:00
LICENSE-APACHE Update copyright in LICENSE-APACHE 2023-04-12 20:05:30 -04:00
LICENSE-MIT
README.md Merge pull request #3656 from arjun051/patch-1 2024-04-03 13:29:42 -06:00
TODO.md Messy snapshot of chapter 13 after copyedit check 2022-10-20 16:39:55 -04:00
book.toml fix: mdBook authors 2022-05-19 09:44:58 -04:00
ferris.css Small tweaks to Ferris size and position 2021-08-18 20:48:38 -04:00
ferris.js Shrink and move ferris when possible 2021-08-15 15:30:50 +08:00
rust-toolchain Update to Rust 1.76 2024-02-19 15:39:35 -05:00
rustfmt.toml Add rustfmt to the update-rustc script 2020-01-25 21:20:41 -05:00
style-guide.md move the book to the top level 2018-11-20 13:45:05 -05:00

README.md

The Rust Programming Language

Build Status

This repository contains the source of "The Rust Programming Language" book.

The book is available in dead-tree form from No Starch Press.

You can also read the book for free online. Please see the book as shipped with the latest stable, beta, or nightly Rust releases. Be aware that issues in those versions may have been fixed in this repository already, as those releases are updated less frequently.

See the releases to download just the code of all the code listings that appear in the book.

Requirements

Building the book requires mdBook, ideally the same version that rust-lang/rust uses in this file. To get it:

$ cargo install mdbook --locked --version <version_num>

Building

To build the book, type:

$ mdbook build

The output will be in the book subdirectory. To check it out, open it in your web browser.

Firefox:

$ firefox book/index.html                       # Linux
$ open -a "Firefox" book/index.html             # OS X
$ Start-Process "firefox.exe" .\book\index.html # Windows (PowerShell)
$ start firefox.exe .\book\index.html           # Windows (Cmd)

Chrome:

$ google-chrome book/index.html                 # Linux
$ open -a "Google Chrome" book/index.html       # OS X
$ Start-Process "chrome.exe" .\book\index.html  # Windows (PowerShell)
$ start chrome.exe .\book\index.html            # Windows (Cmd)

To run the tests:

$ mdbook test

Contributing

We'd love your help! Please see CONTRIBUTING.md to learn about the kinds of contributions we're looking for.

Because the book is printed, and because we want to keep the online version of the book close to the print version when possible, it may take longer than you're used to for us to address your issue or pull request.

So far, we've been doing a larger revision to coincide with Rust Editions. Between those larger revisions, we will only be correcting errors. If your issue or pull request isn't strictly fixing an error, it might sit until the next time that we're working on a large revision: expect on the order of months or years. Thank you for your patience!

Translations

We'd love help translating the book! See the Translations label to join in efforts that are currently in progress. Open a new issue to start working on a new language! We're waiting on mdbook support for multiple languages before we merge any in, but feel free to start!

Spellchecking

To scan source files for spelling errors, you can use the spellcheck.sh script available in the ci directory. It needs a dictionary of valid words, which is provided in ci/dictionary.txt. If the script produces a false positive (say, you used the word BTreeMap which the script considers invalid), you need to add this word to ci/dictionary.txt (keep the sorted order for consistency).