Created
December 20, 2020 23:03
-
-
Save silen-z/8abe281dc7193b04ba93021afb0e16c4 to your computer and use it in GitHub Desktop.
maping and collecting an iterator
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
let values: Vec<Interface> = rkv | |
.store | |
.iter_start(&reader) | |
.unwrap() | |
.map(|value| match value { | |
Ok((_, Value::Str(serialized))) => { | |
let data: Interface = serde_json::from_str(serialized).unwrap(); | |
data | |
} | |
_ => panic!(), | |
}) | |
.collect(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment