Skip to content

create bar project in cargo/dependencies example #1606

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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