Skip to content

Commit 5f778be

Browse files
Update posts/2022-04-07-Rust-1.60.0.md
Co-authored-by: Ryan Levick <[email protected]>
1 parent f027b3d commit 5f778be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

posts/2022-04-07-Rust-1.60.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ There are two things to note in this example:
9292

9393
Namespaced features tackles the first issue. You can now use the `dep:` prefix in the `[features]` table to explicitly refer to an optional dependency without implicitly exposing it as a feature. This gives you more control on how to define the feature corresponding to the optional dependency including hiding optional dependencies behind more descriptive feature names.
9494

95-
Weak dependency features tackles the second issue where the `"package-name/feature-name"` syntax would enable `package-name` if it is an optional dependency. Often this is not what you want, and starting in 1.60, you can add a ? as in `"package-name?/feature-name"` which will only enable the given feature if something else enables the optional dependency.
95+
Weak dependency features tackle the second issue where the `"optional-dependency/feature-name"` syntax would always enable `optional-dependency`. However, often you want to enable the feature on the optional dependency *only* if some other feature has enabled the optional dependency. Starting in 1.60, you can add a ? as in `"package-name?/feature-name"` which will only enable the given feature if something else has enabled the optional dependency.
9696

9797
For example, let's say we have added some serialization support to our library, and it requires enabling a corresponding feature in some optional dependencies. That can be done like this:
9898

0 commit comments

Comments
 (0)