Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove extern crate statements #340

Merged
merged 1 commit into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/collections/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ in your program instead of this allocator.
``` rust,ignore
// Bump pointer allocator implementation

extern crate cortex_m;

use core::alloc::GlobalAlloc;
use core::alloc::{GlobalAlloc, Layout};
use core::cell::UnsafeCell;
use core::ptr;

use cortex_m::interrupt;
Expand Down Expand Up @@ -144,8 +143,7 @@ as they are exact same implementation.
allocator. Just `use` its collections and proceed to instantiate them:

```rust,ignore
extern crate heapless; // v0.4.x

// heapless version: v0.4.x
use heapless::Vec;
use heapless::consts::*;

Expand All @@ -155,6 +153,7 @@ fn main() -> ! {

xs.push(42).unwrap();
assert_eq!(xs.pop(), Some(42));
loop {}
}
```

Expand Down
2 changes: 0 additions & 2 deletions src/interoperability/c-with-rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ For projects with limited dependencies or complexity, or for projects where it i
In the simplest case of compiling a single C file as a dependency to a static library, an example `build.rs` script using the [`cc` crate] would look like this:

```rust,ignore
extern crate cc;

fn main() {
cc::Build::new()
.file("foo.c")
Expand Down
3 changes: 1 addition & 2 deletions src/peripherals/singletons.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ This has a small runtime overhead because we must wrap the `SerialPort` structur
Although we created our own `Peripherals` structure above, it is not necessary to do this for your code. the `cortex_m` crate contains a macro called `singleton!()` that will perform this action for you.

```rust,ignore
#[macro_use(singleton)]
extern crate cortex_m;
use cortex_m::singleton;

fn main() {
// OK if `main` is executed only once
Expand Down