From 034d15a1a135bda84f45c768a1786f1548fe5156 Mon Sep 17 00:00:00 2001 From: Wesley Moore Date: Mon, 8 Jul 2019 11:34:28 +1000 Subject: Annotation values are Vecs --- src/bin/annotaterust.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/annotaterust.rs b/src/bin/annotaterust.rs index 46154fe..8a85563 100644 --- a/src/bin/annotaterust.rs +++ b/src/bin/annotaterust.rs @@ -30,12 +30,12 @@ fn main() { let blobs = git::parse_ls_tree_output(&output).expect("parse"); let mut annotations = HashMap::new(); - annotations.insert(blobs[0].object, Annotation::Markdown { + annotations.entry(blobs[0].object).or_insert(Vec::new()).push(Annotation::Markdown { lineno: 1, title: "Title".to_string(), content: "content".to_string() }); - annotations.insert(blobs[1].object, Annotation::Link { + annotations.entry(blobs[0].object).or_insert(Vec::new()).push(Annotation::Link { lineno: 1, colno: 0, len: 5, -- cgit v1.2.3