Remove all the extern crate definitions

This commit is contained in:
Philipp Oppermann
2018-11-18 15:30:19 +01:00
parent 1d4cbdbe57
commit 0b5e89fbb7
5 changed files with 2 additions and 73 deletions

View File

@@ -244,18 +244,10 @@ To use that crate, we add the following to our `Cargo.toml`:
array-init = "0.0.3"
```
Note that we're using the [`dev-dependencies`] table instead of the `dependencies` table, because we only need the crate for `cargo test` and not for a normal build. Consequently, we also add a `#[cfg(test)]` attribute to the `extern crate` declaration in `main.rs`:
Note that we're using the [`dev-dependencies`] table instead of the `dependencies` table, because we only need the crate for `cargo test` and not for a normal build.
[`dev-dependencies`]: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#development-dependencies
```rust
// in main.rs
#[cfg(test)]
extern crate array_init;
```
Now we can fix our `construct_buffer` function:
```rust