diff options
author | Mario Krehl <mario-krehl@gmx.de> | 2017-12-31 17:34:48 +0100 |
---|---|---|
committer | Mario Krehl <mario-krehl@gmx.de> | 2017-12-31 17:34:48 +0100 |
commit | 17a681a2762d105816c48c94e8928656c3222716 (patch) | |
tree | d7ca5b19ba18f3d88e425311cb6b6273975ac7f7 | |
parent | 6d0705ba3e1fdf72acf4c06cca9f3f45ab1164bf (diff) |
Use the configured file instead of the alias as unique key
-rw-r--r-- | src/main.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main.rs b/src/main.rs index 43d9a48..ea2dee5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -105,8 +105,8 @@ fn hash_map_targets<'a>(c : &'a Config, targets : Vec<Target>) for li in c.items() { for t in targets.clone() { if li.aliases().contains(&t.target) { - if _res.contains_key(&li.alias()) { - if let Some(&mut (_litem, ref mut cnames)) = _res.get_mut(&li.alias()) { + if _res.contains_key(&li.file()) { + if let Some(&mut (_litem, ref mut cnames)) = _res.get_mut(&li.file()) { cnames.push(( cname_from_target(&t.target)?, t.target.clone()) @@ -115,7 +115,7 @@ fn hash_map_targets<'a>(c : &'a Config, targets : Vec<Target>) } else { _res.insert( - li.alias(), + li.file(), ( &li, vec![(cname_from_target(&t.target)?, t.target.clone())] @@ -143,7 +143,7 @@ fn hash_map_iter(h : HashMap<&String, (&LogItem, Vec<(String, String)>)>, d_from -> Result<Vec<TargetData>> { let mut _res = Vec::new(); - for (_alias, &(logitem, ref cns)) in h.iter() { + for (file, &(logitem, ref cns)) in h.iter() { // prepare an empty Vector of Series let mut series_vec = Vec::new(); @@ -153,7 +153,7 @@ fn hash_map_iter(h : HashMap<&String, (&LogItem, Vec<(String, String)>)>, d_from // open the current file for reading let mut line_iter = BufReader::new( - File::open(logitem.file()) + File::open(file) .chain_err(|| format!("antikoerper log file could not be opened: {}", logitem.file()))? ).lines(); |