From f5b6e47f31638db370e190a7675b0f53173d9f2e Mon Sep 17 00:00:00 2001
From: Andrew Walbran <qwandor@google.com>
Date: Tue, 21 Mar 2023 14:57:26 +0000
Subject: [PATCH] Put tinyvec example inline.

---
 Cargo.lock                                    |  7 ------
 Cargo.toml                                    |  1 -
 .../useful-crates/tinyvec-example/Cargo.toml  |  7 ------
 .../useful-crates/tinyvec-example/src/main.rs | 25 -------------------
 src/bare-metal/useful-crates/tinyvec.md       | 11 +++++++-
 5 files changed, 10 insertions(+), 41 deletions(-)
 delete mode 100644 src/bare-metal/useful-crates/tinyvec-example/Cargo.toml
 delete mode 100644 src/bare-metal/useful-crates/tinyvec-example/src/main.rs

diff --git a/Cargo.lock b/Cargo.lock
index 29afabb6..1e7de05d 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2068,13 +2068,6 @@ dependencies = [
  "tinyvec_macros",
 ]
 
-[[package]]
-name = "tinyvec-example"
-version = "0.1.0"
-dependencies = [
- "tinyvec",
-]
-
 [[package]]
 name = "tinyvec_macros"
 version = "0.1.0"
diff --git a/Cargo.toml b/Cargo.toml
index b00d95fd..12d3f650 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,6 +3,5 @@ members = [
   "i18n-helpers",
   "src/exercises",
   "src/bare-metal/useful-crates/allocator-example",
-  "src/bare-metal/useful-crates/tinyvec-example",
   "src/bare-metal/useful-crates/zerocopy-example",
 ]
diff --git a/src/bare-metal/useful-crates/tinyvec-example/Cargo.toml b/src/bare-metal/useful-crates/tinyvec-example/Cargo.toml
deleted file mode 100644
index 9690f653..00000000
--- a/src/bare-metal/useful-crates/tinyvec-example/Cargo.toml
+++ /dev/null
@@ -1,7 +0,0 @@
-[package]
-name = "tinyvec-example"
-version = "0.1.0"
-edition = "2021"
-
-[dependencies]
-tinyvec = "1.6.0"
diff --git a/src/bare-metal/useful-crates/tinyvec-example/src/main.rs b/src/bare-metal/useful-crates/tinyvec-example/src/main.rs
deleted file mode 100644
index af2dd741..00000000
--- a/src/bare-metal/useful-crates/tinyvec-example/src/main.rs
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2023 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// ANCHOR: main
-use tinyvec::{array_vec, ArrayVec};
-
-fn main() {
-    let mut numbers: ArrayVec<[u32; 5]> = array_vec!(42, 66);
-    println!("{numbers:?}");
-    numbers.push(7);
-    println!("{numbers:?}");
-    numbers.remove(1);
-    println!("{numbers:?}");
-}
diff --git a/src/bare-metal/useful-crates/tinyvec.md b/src/bare-metal/useful-crates/tinyvec.md
index 1dd48dee..651446d3 100644
--- a/src/bare-metal/useful-crates/tinyvec.md
+++ b/src/bare-metal/useful-crates/tinyvec.md
@@ -6,7 +6,16 @@ allocated or on the stack, which keeps track of how many elements are used and p
 use more than are allocated.
 
 ```rust,editable,compile_fail
-{{#include tinyvec-example/src/main.rs:main}}
+use tinyvec::{array_vec, ArrayVec};
+
+fn main() {
+    let mut numbers: ArrayVec<[u32; 5]> = array_vec!(42, 66);
+    println!("{numbers:?}");
+    numbers.push(7);
+    println!("{numbers:?}");
+    numbers.remove(1);
+    println!("{numbers:?}");
+}
 ```
 
 <details>