Skip to content

Commit 2663d7d

Browse files
authored
Flip 'foo' and 'bar' to be consistent
The "Renaming dependencies" section initially uses 'foo' as the crate name and 'bar' as a rename, but then swaps them and uses 'bar' as the example crate name in the context of optional dependencies. Now both examples in this section treat 'foo' as the original crate name.
1 parent c5f7fa1 commit 2663d7d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/doc/src/reference/specifying-dependencies.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -429,19 +429,19 @@ Note that if you have an optional dependency like:
429429

430430
```toml
431431
[dependencies]
432-
foo = { version = "0.1", package = 'bar', optional = true }
432+
bar = { version = "0.1", package = 'foo', optional = true }
433433
```
434434

435-
you're depending on the crate `bar` from crates.io, but your crate has a `foo`
436-
feature instead of a `bar` feature. That is, names of features take after the
435+
you're depending on the crate `foo` from crates.io, but your crate has a `bar`
436+
feature instead of a `foo` feature. That is, names of features take after the
437437
name of the dependency, not the package name, when renamed.
438438

439439
Enabling transitive dependencies works similarly, for example we could add the
440440
following to the above manifest:
441441

442442
```toml
443443
[features]
444-
log-debug = ['foo/log-debug'] # using 'bar/log-debug' would be an error!
444+
log-debug = ['bar/log-debug'] # using 'foo/log-debug' would be an error!
445445
```
446446

447447
[crates.io]: https://crates.io/

0 commit comments

Comments
 (0)