summaryrefslogtreecommitdiffstats
path: root/src/doc/embedded-book/src/collections/index.md
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:41 +0000
commit4f9fe856a25ab29345b90e7725509e9ee38a37be (patch)
treee4ffd8a9374cae7b21f7cbfb352927e0e074aff6 /src/doc/embedded-book/src/collections/index.md
parentAdding upstream version 1.68.2+dfsg1. (diff)
downloadrustc-upstream/1.69.0+dfsg1.tar.xz
rustc-upstream/1.69.0+dfsg1.zip
Adding upstream version 1.69.0+dfsg1.upstream/1.69.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/doc/embedded-book/src/collections/index.md')
-rw-r--r--src/doc/embedded-book/src/collections/index.md9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/doc/embedded-book/src/collections/index.md b/src/doc/embedded-book/src/collections/index.md
index 7319a397a..aa03666ac 100644
--- a/src/doc/embedded-book/src/collections/index.md
+++ b/src/doc/embedded-book/src/collections/index.md
@@ -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;
@@ -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::*;
@@ -155,6 +153,7 @@ fn main() -> ! {
xs.push(42).unwrap();
assert_eq!(xs.pop(), Some(42));
+ loop {}
}
```