Skip to content

Commit a4f9417

Browse files
committed
Ch. 01: Show how to work offline
Fixes #3279
1 parent 9220fa1 commit a4f9417

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/ch01-01-installation.md

+20
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,26 @@ integrated development environments (IDEs) have built-in support for Rust. You
142142
can always find a fairly current list of many editors and IDEs on [the tools
143143
page][tools] on the Rust website.
144144

145+
### Working Offline with This Book
146+
147+
In several examples, we will use Rust packages beyond the standard library. To
148+
work through those examples, you will either need to have an internet connection
149+
or to have downloaded those dependencies ahead of time. To download the
150+
dependencies ahead of time, you can run the following commands. (We’ll explain
151+
what `cargo` is and what each of these commands does in detail later.)
152+
153+
```console
154+
$ cargo new get-dependencies
155+
$ cd get-dependencies
156+
157+
```
158+
159+
This will cache the downloads for these packages so you will not need to
160+
download them later. Once you have run this command, you do not need to keep the
161+
`get-dependencies` folder. If you have run this command, you can use the
162+
`--offline` flag with all `cargo` commands in the rest of the book to use these
163+
cached versions instead of attempting to use the network.
164+
145165
[otherinstall]: https://forge.rust-lang.org/infra/other-installation-methods.html
146166
[install]: https://www.rust-lang.org/tools/install
147167
[msvc]: https://rust-lang.github.io/rustup/installation/windows-msvc.html

0 commit comments

Comments
 (0)