summaryrefslogtreecommitdiff
path: root/migration/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'migration/src/main.rs')
-rw-r--r--migration/src/main.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/migration/src/main.rs b/migration/src/main.rs
index 72252a9..ce2e8c7 100644
--- a/migration/src/main.rs
+++ b/migration/src/main.rs
@@ -33,6 +33,7 @@ struct Quote {
key: Key,
#[serde(default = "Vec::new")]
votes: Vec<Vote>,
+ approved: bool,
}
#[derive(Serialize, Deserialize, Debug)]
@@ -89,8 +90,11 @@ fn main() {
.collect::<Vec<T>>()
}
let quotes: Vec<Quote> = parse_all(&quotes);
- let mut quotes: HashMap<String, Quote> =
- quotes.into_iter().map(|q| (q.key.id.clone(), q)).collect();
+ let mut quotes: HashMap<String, Quote> = quotes
+ .into_iter()
+ .filter(|q| q.approved)
+ .map(|q| (q.key.id.clone(), q))
+ .collect();
let mut votes = "".to_string();
File::open(matches.value_of("votes_json").unwrap())