summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2017-10-10 18:47:54 +0200
committerMatthias Beyer <mail@beyermatthias.de>2017-10-31 19:10:11 +0100
commitdfbc69400a578edcb77e248c821d949e2bc68217 (patch)
treed339c3e1f4ea4f40875ba2e815bb6673d78ba572
parent4fa41faa590601e4abcb5ee283f7cb9f9e07fe56 (diff)
Let ContactData be unpacked and derefd
-rw-r--r--lib/domain/libimagcontact/src/contact.rs18
1 files changed, 18 insertions, 0 deletions
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
+ }
+}
+