summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2017-05-03 21:40:05 +0200
committerMatthias Beyer <mail@beyermatthias.de>2017-05-03 21:40:05 +0200
commit89d8abefe7742e6dfcc73c29b5a453cf84374a8e (patch)
tree41231d19afd970ca693b2364d95260f615f69bbc
parent18e13c999b7d0191c13cf9e13a1bdc7f5a7126f0 (diff)
downloadimag-89d8abefe7742e6dfcc73c29b5a453cf84374a8e.zip
imag-89d8abefe7742e6dfcc73c29b5a453cf84374a8e.tar.gz
Ignore duplicated keys
-rw-r--r--libimagstore/Cargo.toml1
-rw-r--r--libimagstore/src/configuration.rs4
-rw-r--r--libimagstore/src/lib.rs1
3 files changed, 5 insertions, 1 deletions
diff --git a/libimagstore/Cargo.toml b/libimagstore/Cargo.toml
index f2e12cc..99ee6c1 100644
--- a/libimagstore/Cargo.toml
+++ b/libimagstore/Cargo.toml
@@ -24,6 +24,7 @@ toml = "^0.4"
version = "2.0.1"
crossbeam = "0.2.*"
walkdir = "1.0.*"
+itertools = "0.6.*"
[dependencies.libimagerror]
path = "../libimagerror"
diff --git a/libimagstore/src/configuration.rs b/libimagstore/src/configuration.rs
index 2b475c9..06e0d3c 100644
--- a/libimagstore/src/configuration.rs
+++ b/libimagstore/src/configuration.rs
@@ -329,6 +329,7 @@ impl AspectConfig {
}
fn get_aspect_names_for_aspect_position(config_name: &'static str, value: &Option<Value>) -> Vec<String> {
+ use itertools::Itertools;
let mut v = vec![];
match *value {
@@ -348,7 +349,8 @@ fn get_aspect_names_for_aspect_position(config_name: &'static str, value: &Optio
None => warn!("No store configuration, cannot get '{}'", config_name),
_ => warn!("Configuration is not a table"),
}
- v
+
+ v.into_iter().unique().collect()
}
#[cfg(test)]
diff --git a/libimagstore/src/lib.rs b/libimagstore/src/lib.rs
index 56c3a74..835704a 100644
--- a/libimagstore/src/lib.rs
+++ b/libimagstore/src/lib.rs
@@ -42,6 +42,7 @@ extern crate toml;
extern crate semver;
extern crate crossbeam;
extern crate walkdir;
+extern crate itertools;
#[macro_use] extern crate libimagerror;
#[macro_use] extern crate libimagutil;