Skip to content

Commit

Permalink
Revert "remove commented Rust code."
Browse files Browse the repository at this point in the history
This reverts commit ec37a64.
  • Loading branch information
axaysagathiya committed Oct 21, 2022
1 parent ec37a64 commit d69371d
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions pkg/scale/decode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,34 @@ func Test_decodeState_decodeSlice(t *testing.T) {
}
}

// // Rust code to encode a map of string to struct.
// let mut btree_map: BTreeMap<String, User> = BTreeMap::new();
// match btree_map.entry("string1".to_string()) {
// Entry::Vacant(entry) => {
// entry.insert(User{
// active: true,
// username: "lorem".to_string(),
// email: "[email protected]".to_string(),
// sign_in_count: 1,
// });
// ()
// },
// Entry::Occupied(_) => (),
// }
// match btree_map.entry("string2".to_string()) {
// Entry::Vacant(entry) => {
// entry.insert(User{
// active: false,
// username: "john".to_string(),
// email: "[email protected]".to_string(),
// sign_in_count: 73,
// });
// ()
// },
// Entry::Occupied(_) => (),
// }
// println!("{:?}", btree_map.encode());

type user struct {
Active bool
Username string
Expand Down

0 comments on commit d69371d

Please sign in to comment.