-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "remove commented Rust code."
This reverts commit ec37a64.
- Loading branch information
1 parent
ec37a64
commit d69371d
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|