From 709166dcf5ac8c365252908a595e0afe68ee2a25 Mon Sep 17 00:00:00 2001 From: okxint Date: Sun, 30 Aug 2026 11:11:10 +0530 Subject: [PATCH] ch01: add `cargo fetch` to the working-offline setup steps `cargo add` only updates Cargo.toml / Cargo.lock; it does not download the crate archives. Without a subsequent fetch or build, `--offline` fails with "attempting to make an HTTP request". Add `cargo fetch` as a fourth step so readers actually cache the .crate files before going offline, and update the surrounding prose to match (plural "these commands", "download and cache" instead of "cache the downloads"). Fixes #4817 --- src/ch01-01-installation.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ch01-01-installation.md b/src/ch01-01-installation.md index a9e03f534a..0584b30243 100644 --- a/src/ch01-01-installation.md +++ b/src/ch01-01-installation.md @@ -170,11 +170,12 @@ what `cargo` is and what each of these commands does in detail later.) $ cargo new get-dependencies $ cd get-dependencies $ cargo add rand@0.10.1 trpl@0.2.0 +$ cargo fetch ``` -This will cache the downloads for these packages so you will not need to -download them later. Once you have run this command, you do not need to keep the -`get-dependencies` folder. If you have run this command, you can use the +This will download and cache the packages so you will not need to download them +later. Once you have run these commands, you do not need to keep the +`get-dependencies` folder. If you have run these commands, you can use the `--offline` flag with all `cargo` commands in the rest of the book to use these cached versions instead of attempting to use the network.