Skip to content

Commit

Permalink
chore: fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
dj8yf0μl committed Oct 5, 2023
1 parent 946b4d2 commit d55bde6
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fn test_simple_struct() {
## Features

Opting out from Serde allows borsh to have some features that currently are not available for serde-compatible serializers.
Currently we support two features: `borsh(init=<your initilization method name>` and `borsh(skip)` (the former one not available in Serde).
Currently we support two features: `borsh(init=<your initialization method name>` and `borsh(skip)` (the former one not available in Serde).

`borsh(init=...)` allows to automatically run an initialization function right after deserialization. This adds a lot of convenience for objects that are architectured to be used as strictly immutable. Usage example:

Expand All @@ -65,7 +65,7 @@ impl Message {
}
```

`borsh(skip)` allows to skip serializing/deserializing fields, assuming they implement `Default` trait, similary to `#[serde(skip)]`.
`borsh(skip)` allows to skip serializing/deserializing fields, assuming they implement `Default` trait, similarly to `#[serde(skip)]`.

```rust
#[derive(BorshSerialize, BorshDeserialize)]
Expand Down
2 changes: 1 addition & 1 deletion borsh-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ where
Each of `declaration` and `definitions` nested sub-attributes takes literal string value, which is a syn's [ExprPath](syn::ExprPath).
Currently both `declaration` and `definitions` are required to be specifed at the same time.
Currently both `declaration` and `definitions` are required to be specified at the same time.
###### usage
Expand Down
2 changes: 1 addition & 1 deletion borsh/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//! * `BorshSchema` trait allows any type that implements it to be self-descriptive, i.e. generate it's own schema;
//! * `Declaration` is used to describe the type identifier, e.g. `HashMap<u64, String>`;
//! * `Definition` is used to describe the structure of the type;
//! * `BorshSchemaContainer` is used to store all declarations and defintions that are needed to work with a single type.
//! * `BorshSchemaContainer` is used to store all declarations and definitions that are needed to work with a single type.
#![allow(dead_code)] // Unclear why rust check complains on fields of `Definition` variants.
use crate as borsh; // For `#[derive(BorshSerialize, BorshDeserialize)]`.
Expand Down
2 changes: 1 addition & 1 deletion borsh/src/schema/container_ext/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub enum Error {
/// Declared tag width is too small. Tags must be large enough to represent
/// possible length of sequence.
TagTooNarrow(Declaration),
/// only 0, 1, 2, 4 and 8 bytes long enum tags and sequences' `length_width` are alowed
/// only 0, 1, 2, 4 and 8 bytes long enum tags and sequences' `length_width` are allowed
TagNotPowerOfTwo(Declaration),
/// Some of the declared types were lacking definition, which is considered
/// a container's validation error
Expand Down
2 changes: 1 addition & 1 deletion docs/migration_guides/v0.9_to_v1.0.0_near_sdk_rs.md
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ index 834fc98..7d1df75 100644
which would transform into following bound on trait's implementation:
```rust
// line with `T: core::default::Default,` dissappeared
// line with `T: core::default::Default,` disappeared
impl<T> borsh::de::BorshDeserialize for IndexMap<T>
where
T: BorshSerialize,
Expand Down

0 comments on commit d55bde6

Please sign in to comment.