Impl Into<Table> for EntryHeader

This commit is contained in:
Matthias Beyer 2016-02-12 22:02:33 +01:00
parent df9313c599
commit 794e7617e3

View file

@ -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<Table> 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<String, Value>
let mut m = BTreeMap::new();