Skip to content

Commit

Permalink
create bar project in cargo/dependencies example (#1606)
Browse files Browse the repository at this point in the history
By creating the `bar` project, the sample configuration file that references a
local `bar` project will be valid.
  • Loading branch information
augustfengd authored Sep 30, 2022
1 parent 640d785 commit 7a4484f
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/cargo/deps.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ To create a new Rust project,
# A binary
cargo new foo

# OR A library
cargo new --lib foo
# A library
cargo new --lib bar
```

For the rest of this chapter, let's assume we are making a binary, rather than
Expand All @@ -21,14 +21,19 @@ a library, but all of the concepts are the same.
After the above commands, you should see a file hierarchy like this:

```txt
foo
├── Cargo.toml
└── src
└── main.rs
.
├── bar
│ ├── Cargo.toml
│ └── src
│ └── lib.rs
└── foo
├── Cargo.toml
└── src
└── main.rs
```

The `main.rs` is the root source file for your new project -- nothing new there.
The `Cargo.toml` is the config file for `cargo` for this project (`foo`). If you
The `main.rs` is the root source file for your new `foo` project -- nothing new there.
The `Cargo.toml` is the config file for `cargo` for this project. If you
look inside it, you should see something like this:

```toml
Expand Down

0 comments on commit 7a4484f

Please sign in to comment.