Skip to content

Commit 4add83a

Browse files
authored
Fix specifying features in README (#331, #330)
1 parent 50e678f commit 4add83a

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,23 +153,25 @@ use derive_more::Display;
153153

154154
To avoid redundant compilation times, by default no derives are supported.
155155
You have to enable each type of derive as a feature in `Cargo.toml`:
156-
157156
```toml
158157
[dependencies]
159-
derive_more = "=1.0.0-beta.6"
160158
# You can specify the types of derives that you need for less time spent
161159
# compiling. For the full list of features see this crate its `Cargo.toml`.
162-
features = ["from", "add", "iterator"]
163-
160+
derive_more = { version = "=1.0.0-beta.6", features = ["from", "add", "iterator"] }
161+
```
162+
```toml
163+
[dependencies]
164164
# If you don't care much about compilation times and simply want to have
165165
# support for all the possible derives, you can use the "full" feature.
166-
features = ["full"]
167-
166+
derive_more = { version = "=1.0.0-beta.6", features = ["full"] }
167+
```
168+
```toml
169+
[dependencies]
168170
# If you run in a `no_std` environment you should disable the default features,
169171
# because the only default feature is the "std" feature.
170172
# NOTE: You can combine this with "full" feature to get support for all the
171173
# possible derives in a `no_std` environment.
172-
default-features = false
174+
derive_more = { version = "=1.0.0-beta.6", default-features = false }
173175
```
174176

175177
And this to the top of your Rust file:

0 commit comments

Comments
 (0)