add versionize for VecDequeue/HashMap/HashSet.#25
Closed
imaginezz wants to merge 1 commit intofirecracker-microvm:mainfrom
Closed
add versionize for VecDequeue/HashMap/HashSet.#25imaginezz wants to merge 1 commit intofirecracker-microvm:mainfrom
imaginezz wants to merge 1 commit intofirecracker-microvm:mainfrom
Conversation
f7cee51 to
5bc6c21
Compare
- add versionize support for VecDequeue/HashMap/HashSet. Signed-off-by: JasonBian <zizheng.bian@linux.alibaba.com>
5bc6c21 to
f006078
Compare
Author
sandreim
reviewed
Oct 30, 2020
| } | ||
| } | ||
|
|
||
| impl<T> Versionize for VecDeque<T> |
Contributor
There was a problem hiding this comment.
This is almost like implementation for Vec. Can we do this with a macro to avoid duplicating code ?
| .map_err(|ref err| VersionizeError::Serialize(format!("{:?}", err)))?; | ||
| // Walk the hash map and write each element. | ||
| for (k, v) in self.iter() { | ||
| (k.clone(), v.clone()).serialize(writer, version_map, app_version)?; |
Contributor
There was a problem hiding this comment.
Can we avoid the temporary clones here ?
| ) | ||
| .unwrap(); | ||
|
|
||
| assert_eq!(store, restore); |
Contributor
There was a problem hiding this comment.
Please add negative tests.
| <HashSet<String> as Versionize>::deserialize(&mut snapshot_mem.as_slice(), &vm, 1) | ||
| .unwrap(); | ||
|
|
||
| assert_eq!(store, restore); |
|
Hello @imaginezz ! Do you plan to continue working on this PR? |
Author
|
I will close this pr, and update in #37 |
6 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: JasonBianzizheng.bian@linux.alibaba.com
Reason for This PR
Added support for some of the commonly used data structures: VecDeque, HashMap, and HashSet
Description of Changes
primitives.rs.lib.rs.License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license.
PR Checklist
[Author TODO: Meet these criteria.][Reviewer TODO: Verify that these criteria are met. Request changes if not]git commit -s).unsafecode is properly documented.CHANGELOG.md.