diff --git a/Cargo.toml b/Cargo.toml index 974dbcf..c261f69 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,3 +13,11 @@ categories = ["data-structures", "caching"] [dependencies] stable_deref_trait = "1.1.1" indexmap = { version = "1.6", optional = true } + +[package.metadata.docs.rs] +features = ["indexmap"] + +[[example]] +name = "string_interner" +path = "examples/string_interner.rs" +required-features = ["indexmap"] diff --git a/README.md b/README.md index 74a3993..72bebee 100644 --- a/README.md +++ b/README.md @@ -9,3 +9,9 @@ This crate provides various "frozen" collections. These are append-only collections where references to entries can be held on to even across insertions. This is safe because these collections only support storing data that's present behind some indirection -- i.e. `String`, `Vec`, `Box`, etc, and they only yield references to the data behind the allocation (`&str`, `&[T]`, and `&T` respectively) The typical use case is having a global cache of strings or other data which the rest of the program borrows from. + +### Running all examples + +```bash +cargo test --examples --features indexmap +```