From 18d760fd41143c520da6ba86982d4704c1369689 Mon Sep 17 00:00:00 2001 From: Denis Varlakov Date: Thu, 22 Aug 2024 17:29:40 +0200 Subject: [PATCH] Update docs Signed-off-by: Denis Varlakov --- udigest/src/as_.rs | 14 +++++++------- udigest/src/lib.rs | 4 +++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/udigest/src/as_.rs b/udigest/src/as_.rs index dd5d16d..a5ba085 100644 --- a/udigest/src/as_.rs +++ b/udigest/src/as_.rs @@ -2,13 +2,13 @@ //! //! It's supposed to be used in a pair with derive proc macro and `as` attribute. //! For instance, it can be used to digest a hash map "as a btree map": -//! ```rust -//! #[derive(udigest::Digestable)] -//! pub struct Attributes( -//! #[udigest(as = std::collections::BTreeMap<_, udigest::Bytes>)] -//! std::collections::HashMap>, -//! ); -//! ``` +//! ```rust +//! #[derive(udigest::Digestable)] +//! pub struct Attributes( +//! #[udigest(as = std::collections::BTreeMap<_, udigest::Bytes>)] +//! std::collections::HashMap>, +//! ); +//! ``` //! //! See more examples in [macro@Digestable] macro docs. diff --git a/udigest/src/lib.rs b/udigest/src/lib.rs index 99866d7..122677e 100644 --- a/udigest/src/lib.rs +++ b/udigest/src/lib.rs @@ -202,7 +202,9 @@ pub use encoding::Buffer; /// ``` /// /// When structure is digested, the hash map is converted into btree map. `_` in `BTreeMap<_, udigest::Bytes>` -/// says that the key should be kept as it is: `String` string will be digested. +/// says that the key should be kept as it is: `String` string will be digested. The macro +/// replaces underscores (also called "infer types") with [`udigest::as_::Same`], which +/// indicates that the same digestion rules should be used as for the original type. /// `udigest::Bytes` indicates that the value `Vec` should be digested as bytes, not as /// list of u8 which would be a default behavior. ///