mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Remove all the extern crate definitions
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user