From cf234437d78f6a63ba58371e74242321ba062c9a Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 16 Apr 2019 18:18:43 +0200 Subject: [PATCH] Implement Partial for Config With this implemented, we can fetch the appropriate configuration easily from the configuration. Signed-off-by: Matthias Beyer --- lib/entry/libimagentryref/src/reference.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/entry/libimagentryref/src/reference.rs b/lib/entry/libimagentryref/src/reference.rs index 64c77a41..fe9014d8 100644 --- a/lib/entry/libimagentryref/src/reference.rs +++ b/lib/entry/libimagentryref/src/reference.rs @@ -28,6 +28,7 @@ use libimagerror::errors::ErrorMsg as EM; use toml::Value; use toml_query::read::TomlValueReadExt; +use toml_query::read::Partial; use toml_query::delete::TomlValueDeleteExt; use toml_query::insert::TomlValueInsertExt; use failure::Fallible as Result; @@ -66,6 +67,11 @@ impl Deref for Config { } } +impl<'a> Partial<'a> for Config { + const LOCATION: &'static str = "ref.basepathes"; + type Output = Self; +} + provide_kindflag_path!(pub IsRef, "ref.is_ref"); /// Fassade module