Skip to content

Commit

Permalink
chore: remove most of hidden comments to not mess view on gh
Browse files Browse the repository at this point in the history
  • Loading branch information
dj8yf0μl committed Dec 29, 2024
1 parent ba3b63a commit 5052acf
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 36 deletions.
36 changes: 18 additions & 18 deletions docs/rustdoc_include/borsh_deserialize.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand All @@ -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 {
Expand All @@ -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
}
Expand Down Expand Up @@ -210,7 +210,7 @@ parameters encountered in annotated field.
```rust
# use borsh::BorshDeserialize;
use borsh::BorshDeserialize;
#[derive(BorshDeserialize)]
struct A {
x: u64,
Expand All @@ -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<T, U> {
a: String,
Expand All @@ -258,7 +258,7 @@ struct A<T, U> {
```rust
# use borsh::BorshDeserialize;
use borsh::BorshDeserialize;
trait TraitName {
type Associated;
fn method(&self);
Expand All @@ -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<K, V, U>(
#[borsh(skip, bound(deserialize = ""))]
Expand Down
10 changes: 5 additions & 5 deletions docs/rustdoc_include/borsh_schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand All @@ -212,7 +212,7 @@ where
```
```rust
# use borsh::BorshSchema;
use borsh::BorshSchema;
use core::marker::PhantomData;
trait EntityRef {
Expand Down
26 changes: 13 additions & 13 deletions docs/rustdoc_include/borsh_serialize.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -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,
Expand All @@ -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<T, U> {
a: String,
Expand All @@ -207,7 +207,7 @@ struct A<T, U> {
```rust
# use borsh::BorshSerialize;
use borsh::BorshSerialize;
trait TraitName {
type Associated;
fn method(&self);
Expand Down

0 comments on commit 5052acf

Please sign in to comment.