Skip to content

Commit

Permalink
doc: add #[borsh(crate =...)] mentions in readme (#1129) (#1132)
Browse files Browse the repository at this point in the history
  • Loading branch information
dj8yfo authored Jan 16, 2024
1 parent 9ce0cdc commit fefb664
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ use near_sdk::{near_bindgen, env};

#[near_bindgen]
#[derive(Default, BorshDeserialize, BorshSerialize)]
#[borsh(crate = "near_sdk::borsh")]
pub struct StatusMessage {
records: HashMap<AccountId, String>,
}
Expand Down Expand Up @@ -120,6 +121,7 @@ You can also prohibit `Default` trait initialization by using `near_sdk::PanicOn
```rust
#[near_bindgen]
#[derive(BorshDeserialize, BorshSerialize, PanicOnDefault)]
#[borsh(crate = "near_sdk::borsh")]
pub struct StatusMessage {
records: HashMap<String, String>,
}
Expand Down Expand Up @@ -189,6 +191,7 @@ The general workflow is the following:

#[near_bindgen]
#[derive(Default, BorshSerialize, BorshDeserialize)]
#[borsh(crate = "near_sdk::borsh")]
pub struct MyContract {
data: HashMap<u64, u64>
}
Expand Down

0 comments on commit fefb664

Please sign in to comment.