summaryrefslogtreecommitdiff
path: root/vendor/nonempty/README.md
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-07-02 18:36:06 -0600
committermo khan <mo@mokhan.ca>2025-07-02 18:36:06 -0600
commit8cdfa445d6629ffef4cb84967ff7017654045bc2 (patch)
tree22f0b0907c024c78d26a731e2e1f5219407d8102 /vendor/nonempty/README.md
parent4351c74c7c5f97156bc94d3a8549b9940ac80e3f (diff)
chore: add vendor directory
Diffstat (limited to 'vendor/nonempty/README.md')
-rw-r--r--vendor/nonempty/README.md20
1 files changed, 20 insertions, 0 deletions
diff --git a/vendor/nonempty/README.md b/vendor/nonempty/README.md
new file mode 100644
index 00000000..0b18b605
--- /dev/null
+++ b/vendor/nonempty/README.md
@@ -0,0 +1,20 @@
+# Correct by Construction Non-Empty List
+
+This package exposes a type `NonEmpty<T>` with a data representation
+that guarantees non-emptiness statically:
+
+ struct NonEmpty<T>(T, Vec<T>)
+
+The library is meant to have an interface similar to `std::vec::Vec`:
+
+ use nonempty::NonEmpty;
+
+ let mut l = NonEmpty::new(42);
+
+ assert_eq!(l.first(), &42);
+
+ l.push(36);
+ l.push(58);
+
+ let v: Vec<i32> = l.into();
+ assert_eq!(v, vec![42, 36, 58]);