From 5052acf91776e1b23f229050c932b51ae113859d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dj8yf0=CE=BCl?= Date: Sun, 29 Dec 2024 02:28:16 +0200 Subject: [PATCH] chore: remove most of hidden comments to not mess view on gh --- docs/rustdoc_include/borsh_deserialize.md | 36 +++++++++++------------ docs/rustdoc_include/borsh_schema.md | 10 +++---- docs/rustdoc_include/borsh_serialize.md | 26 ++++++++-------- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/docs/rustdoc_include/borsh_deserialize.md b/docs/rustdoc_include/borsh_deserialize.md index 332a4954b..0232d661c 100644 --- a/docs/rustdoc_include/borsh_deserialize.md +++ b/docs/rustdoc_include/borsh_deserialize.md @@ -108,7 +108,7 @@ This adds a lot of convenience for objects that are architectured to be used as ```rust type CryptoHash = String; -# use borsh::BorshDeserialize; +use borsh::BorshDeserialize; #[derive(BorshDeserialize)] #[borsh(init=init)] struct Message { @@ -139,7 +139,7 @@ You must specify `use_discriminant` for all enums with explicit discriminants in This is equivalent of borsh version 0.10.3 (explicit discriminant is ignored and this enum is equivalent to `A` without explicit discriminant): ```rust -# use borsh::BorshDeserialize; +use borsh::BorshDeserialize; #[derive(BorshDeserialize)] #[borsh(use_discriminant = false)] enum A { @@ -150,7 +150,7 @@ enum A { To have explicit discriminant value serialized as is, you must specify `borsh(use_discriminant=true)` for enum. ```rust -# use borsh::BorshDeserialize; +use borsh::BorshDeserialize; #[derive(BorshDeserialize)] #[borsh(use_discriminant = true)] enum B { @@ -164,7 +164,7 @@ enum B { This case is not supported: ```rust,compile_fail -# use borsh::BorshDeserialize; +use borsh::BorshDeserialize; const fn discrim() -> isize { 0x14 } @@ -210,7 +210,7 @@ parameters encountered in annotated field. ```rust -# use borsh::BorshDeserialize; +use borsh::BorshDeserialize; #[derive(BorshDeserialize)] struct A { x: u64, @@ -235,15 +235,15 @@ Attribute adds possibility to override bounds for `BorshDeserialize` in order to 2. fixing complex cases, when derive hasn't figured out the right bounds on type parameters automatically. ```rust -# use borsh::BorshDeserialize; -# #[cfg(feature = "hashbrown")] -# use hashbrown::HashMap; -# #[cfg(feature = "std")] -# use std::collections::HashMap; +use borsh::BorshDeserialize; +#[cfg(feature = "hashbrown")] +use hashbrown::HashMap; +#[cfg(feature = "std")] +use std::collections::HashMap; use core::hash::Hash; /// additional bounds `T: Ord + Hash + Eq` (required by `HashMap`) are injected into /// derived trait implementation via attribute to avoid adding the bounds on the struct itself -# #[cfg(hash_collections)] +#[cfg(any(feature = "hashbrown", feature = "std"))] #[derive(BorshDeserialize)] struct A { a: String, @@ -258,7 +258,7 @@ struct A { ```rust -# use borsh::BorshDeserialize; +use borsh::BorshDeserialize; trait TraitName { type Associated; fn method(&self); @@ -281,14 +281,14 @@ where irrelevant of whether `#[borsh(skip)]` attribute is present. ```rust -# use borsh::BorshDeserialize; -# #[cfg(feature = "hashbrown")] -# use hashbrown::HashMap; -# #[cfg(feature = "std")] -# use std::collections::HashMap; +use borsh::BorshDeserialize; +#[cfg(feature = "hashbrown")] +use hashbrown::HashMap; +#[cfg(feature = "std")] +use std::collections::HashMap; /// implicit derived `core::default::Default` bounds on `K` and `V` type parameters are removed by /// empty bound specified, as `HashMap` has its own `Default` implementation -# #[cfg(hash_collections)] +#[cfg(any(feature = "hashbrown", feature = "std"))] #[derive(BorshDeserialize)] struct A( #[borsh(skip, bound(deserialize = ""))] diff --git a/docs/rustdoc_include/borsh_schema.md b/docs/rustdoc_include/borsh_schema.md index 819f05a16..b6bbe8545 100644 --- a/docs/rustdoc_include/borsh_schema.md +++ b/docs/rustdoc_include/borsh_schema.md @@ -97,7 +97,7 @@ You must specify `use_discriminant` for all enums with explicit discriminants in This is equivalent of borsh version 0.10.3 (explicit discriminant is ignored and this enum is equivalent to `A` without explicit discriminant): ```rust -# use borsh::BorshSchema; +use borsh::BorshSchema; #[derive(BorshSchema)] #[borsh(use_discriminant = false)] enum A { @@ -108,7 +108,7 @@ enum A { To have explicit discriminant value serialized as is, you must specify `borsh(use_discriminant=true)` for enum. ```rust -# use borsh::BorshSchema; +use borsh::BorshSchema; #[derive(BorshSchema)] #[borsh(use_discriminant = true)] enum B { @@ -158,7 +158,7 @@ enum X { `#[borsh(skip)]` makes derive skip adding any type parameters, present in the field, to parameters bound by `borsh::BorshSchema`. ```rust -# use borsh::BorshSchema; +use borsh::BorshSchema; #[derive(BorshSchema)] struct A { x: u64, @@ -193,7 +193,7 @@ Such an entry instructs `BorshSchema` derive to: ```rust -# use borsh::BorshSchema; +use borsh::BorshSchema; trait TraitName { type Associated; fn method(&self); @@ -212,7 +212,7 @@ where ``` ```rust -# use borsh::BorshSchema; +use borsh::BorshSchema; use core::marker::PhantomData; trait EntityRef { diff --git a/docs/rustdoc_include/borsh_serialize.md b/docs/rustdoc_include/borsh_serialize.md index fb40158f1..db87e6865 100644 --- a/docs/rustdoc_include/borsh_serialize.md +++ b/docs/rustdoc_include/borsh_serialize.md @@ -100,8 +100,8 @@ You must specify `use_discriminant` for all enums with explicit discriminants in This is equivalent of borsh version 0.10.3 (explicit discriminant is ignored and this enum is equivalent to `A` without explicit discriminant): ```rust -# use borsh::BorshSerialize; -# +use borsh::BorshSerialize; + #[derive(BorshSerialize)] #[borsh(use_discriminant = false)] enum A { @@ -112,8 +112,8 @@ enum A { To have explicit discriminant value serialized as is, you must specify `borsh(use_discriminant=true)` for enum. ```rust -# use borsh::BorshSerialize; -# +use borsh::BorshSerialize; + #[derive(BorshSerialize)] #[borsh(use_discriminant = true)] enum B { @@ -163,8 +163,8 @@ enum X { `#[borsh(skip)]` makes derive skip adding any type parameters, present in the field, to parameters bound by `borsh::ser::BorshSerialize`. ```rust -# use borsh::BorshSerialize; -# +use borsh::BorshSerialize; + #[derive(BorshSerialize)] struct A { x: u64, @@ -187,14 +187,14 @@ Attribute adds possibility to override bounds for `BorshSerialize` in order to e 2. fixing complex cases, when derive hasn't figured out the right bounds on type parameters automatically. ```rust -# use borsh::BorshSerialize; -# #[cfg(feature = "hashbrown")] -# use hashbrown::HashMap; -# #[cfg(feature = "std")] -# use std::collections::HashMap; +use borsh::BorshSerialize; +#[cfg(feature = "hashbrown")] +use hashbrown::HashMap; +#[cfg(feature = "std")] +use std::collections::HashMap; /// additional bound `T: Ord` (required by `HashMap`) is injected into /// derived trait implementation via attribute to avoid adding the bounds on the struct itself -# #[cfg(hash_collections)] +#[cfg(any(feature = "hashbrown", feature = "std"))] #[derive(BorshSerialize)] struct A { a: String, @@ -207,7 +207,7 @@ struct A { ```rust -# use borsh::BorshSerialize; +use borsh::BorshSerialize; trait TraitName { type Associated; fn method(&self);