From 3797d492897b9210ba5071dbd2af99badaf5e3b9 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Wed, 26 Dec 2018 16:05:34 +0100 Subject: Print links to sources for the marks. --- src/main.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index f6ea539..2287575 100644 --- a/src/main.rs +++ b/src/main.rs @@ -42,7 +42,6 @@ fn test_capitalize() { assert_eq!("", capitalize("")); } -#[allow(dead_code)] #[derive(Deserialize)] struct Mark { name: String, @@ -68,6 +67,15 @@ fn print_entry(m: &Mark) { if !m.symbols.is_empty() { println!("Symboler: {}", m.symbols.join(", ")); } + + if !m.links.is_empty() { + println!("Kilder:"); + for l in &m.links { + for (source, url) in l.iter() { + println!(" {}: {}", source, url); + } + } + } } fn main() { -- cgit v1.2.3