From 2663d7d3af1674cd669c6f19ae43673b75e85b4b Mon Sep 17 00:00:00 2001 From: Michael Diamond Date: Sun, 31 Jan 2021 23:27:56 -0800 Subject: [PATCH] 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. --- src/doc/src/reference/specifying-dependencies.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/doc/src/reference/specifying-dependencies.md b/src/doc/src/reference/specifying-dependencies.md index 3e679ce3088..ac6821363a7 100644 --- a/src/doc/src/reference/specifying-dependencies.md +++ b/src/doc/src/reference/specifying-dependencies.md @@ -429,11 +429,11 @@ Note that if you have an optional dependency like: ```toml [dependencies] -foo = { version = "0.1", package = 'bar', optional = true } +bar = { version = "0.1", package = 'foo', optional = true } ``` -you're depending on the crate `bar` from crates.io, but your crate has a `foo` -feature instead of a `bar` feature. That is, names of features take after the +you're depending on the crate `foo` from crates.io, but your crate has a `bar` +feature instead of a `foo` feature. That is, names of features take after the name of the dependency, not the package name, when renamed. Enabling transitive dependencies works similarly, for example we could add the @@ -441,7 +441,7 @@ following to the above manifest: ```toml [features] -log-debug = ['foo/log-debug'] # using 'bar/log-debug' would be an error! +log-debug = ['bar/log-debug'] # using 'foo/log-debug' would be an error! ``` [crates.io]: https://crates.io/