From dfbc69400a578edcb77e248c821d949e2bc68217 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 10 Oct 2017 18:47:54 +0200 Subject: [PATCH] Let ContactData be unpacked and derefd --- lib/domain/libimagcontact/src/contact.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/domain/libimagcontact/src/contact.rs b/lib/domain/libimagcontact/src/contact.rs index 37735f88..14a80e3b 100644 --- a/lib/domain/libimagcontact/src/contact.rs +++ b/lib/domain/libimagcontact/src/contact.rs @@ -17,6 +17,8 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // +use std::ops::Deref; + use vobject::Component; use toml::Value; use toml_query::read::TomlValueReadExt; @@ -69,4 +71,20 @@ impl Contact for Entry { pub struct ContactData(Component); +impl ContactData { + + pub fn into_inner(self) -> Component { + self.0 + } + +} + +impl Deref for ContactData { + type Target = Component; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} +