Skip to content

Commit 9df3223

Browse files
author
dj8yf0μl
committed
doc: add reference in README.md
1 parent 1ee8090 commit 9df3223

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ enum A {
9999
}
100100
```
101101

102+
## Advanced examples
103+
104+
Some of the less trivial examples are present in [examples](./borsh/examples) folder:
105+
106+
- [implementing `BorshSerialize`/`BorshDeserialize` for third-party `serde_json::Value`](./borsh/examples/serde_json_value.rs)
107+
102108
## Testing
103109

104110
Integration tests should generally be preferred to unit ones. Root module of integration tests of `borsh` crate is [linked](./borsh/tests/tests.rs) here.

borsh/examples/serde_json_value.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::collections::HashMap;
22

33
use borsh::{BorshDeserialize, BorshSerialize};
44

5-
od serde_json_value {
5+
mod serde_json_value {
66
pub use de::deserialize_value;
77
pub use ser::serialize_value;
88
mod ser {
@@ -246,6 +246,7 @@ struct SerdeJsonAsField {
246246
}
247247

248248
fn main() {
249+
// original code is from https://github.com/near/borsh-rs/pull/312
249250
let original = serde_json::json!({
250251
"null": null,
251252
"true": true,

0 commit comments

Comments
 (0)