From 463e83ab313d2e7ec247afe39a369641a4c4ad3f Mon Sep 17 00:00:00 2001 From: Avril Date: Fri, 11 Mar 2022 17:26:54 +0000 Subject: [PATCH] primitive.rs: Fix doc typo. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fortune for smallmap's current commit: Future blessing − 末吉 --- Cargo.toml | 12 ++++++++++++ src/lib.rs | 2 +- src/primitive.rs | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e65c3d4..d0fd5cf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,8 +9,20 @@ authors = ["Avril "] edition = "2018" license = "MIT" +[profile.release] +opt-level = 3 +lto = "fat" +codegen-units = 1 +panic = "unwind" +strip=true + +[features] +# TODO: maybe add an FFI feature, to allow C projects to use it? idk if that's worth it really... + [dependencies] serde = {version = "1.0.116", features = ["derive"], optional = true} +# TODO: optional smallvec feature: instead of heap-allocating the first page, it can be placed on the stack. + [dev-dependencies] serde_json = "1.0.59" diff --git a/src/lib.rs b/src/lib.rs index a66fcac..ad64870 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -212,7 +212,7 @@ where K: Collapse /// A small hashtable-like map with byte sized key indecies. #[derive(Debug, Clone, PartialEq, Eq, Hash, Default)] #[cfg_attr(feature="serde", derive(serde::Serialize, serde::Deserialize))] -// TODO: Replace with SmallVec<[Page; 1]> maybe? +// TODO: Replace with `SmallVec<[Page; 1]>` when feature that adds `smallvec` is enabled (this will allocate the first page on the stack, and the rest on the heap. pub struct Map(Vec>); impl Map diff --git a/src/primitive.rs b/src/primitive.rs index 4ec10c4..d78220c 100644 --- a/src/primitive.rs +++ b/src/primitive.rs @@ -1,4 +1,4 @@ -//! Contains `Collapse` impls for primitive types through a newtime shim. +//! Contains `Collapse` impls for primitive types through a newtype shim. //! //! # Why //! Such wrappers are a workaround for the lack of template specialisation available in Rust so far, as the generic `impl Collapse for T` still requires computing the hash of the internal types before reducing to the `u8` page index.