Skip to content

Commit

Permalink
doc: add reference in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dj8yf0μl committed Oct 29, 2024
1 parent 1ee8090 commit 9df3223
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ enum A {
}
```

## Advanced examples

Some of the less trivial examples are present in [examples](./borsh/examples) folder:

- [implementing `BorshSerialize`/`BorshDeserialize` for third-party `serde_json::Value`](./borsh/examples/serde_json_value.rs)

## Testing

Integration tests should generally be preferred to unit ones. Root module of integration tests of `borsh` crate is [linked](./borsh/tests/tests.rs) here.
Expand Down
3 changes: 2 additions & 1 deletion borsh/examples/serde_json_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::collections::HashMap;

use borsh::{BorshDeserialize, BorshSerialize};

od serde_json_value {
mod serde_json_value {
pub use de::deserialize_value;
pub use ser::serialize_value;
mod ser {
Expand Down Expand Up @@ -246,6 +246,7 @@ struct SerdeJsonAsField {
}

fn main() {
// original code is from https://github.com/near/borsh-rs/pull/312
let original = serde_json::json!({
"null": null,
"true": true,
Expand Down

0 comments on commit 9df3223

Please sign in to comment.