From 794e7617e3aeb2e7a3fa6315bd455df2f9ffb47a Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 12 Feb 2016 22:02:33 +0100 Subject: [PATCH] Impl Into for EntryHeader --- libimagstore/src/store.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs index 1e289622..a0bb1855 100644 --- a/libimagstore/src/store.rs +++ b/libimagstore/src/store.rs @@ -7,6 +7,7 @@ use std::sync::Arc; use std::sync::RwLock; use std::collections::BTreeMap; use std::io::{Seek, SeekFrom}; +use std::convert::Into; use toml::{Table, Value}; use regex::Regex; @@ -733,6 +734,17 @@ impl EntryHeader { } +impl Into
for EntryHeader { + + fn into(self) -> Table { + match self.header { + Value::Table(t) => t, + _ => panic!("EntryHeader is not a table!"), + } + } + +} + fn build_default_header() -> Value { // BTreeMap let mut m = BTreeMap::new();