Impl From<Table> for EntryHeader

This commit is contained in:
Matthias Beyer 2016-02-12 22:07:15 +01:00
parent 794e7617e3
commit 9951422dc4

View file

@ -7,6 +7,7 @@ use std::sync::Arc;
use std::sync::RwLock; use std::sync::RwLock;
use std::collections::BTreeMap; use std::collections::BTreeMap;
use std::io::{Seek, SeekFrom}; use std::io::{Seek, SeekFrom};
use std::convert::From;
use std::convert::Into; use std::convert::Into;
use toml::{Table, Value}; use toml::{Table, Value};
@ -745,6 +746,14 @@ impl Into<Table> for EntryHeader {
} }
impl From<Table> for EntryHeader {
fn from(t: Table) -> EntryHeader {
EntryHeader { header: Value::Table(t) }
}
}
fn build_default_header() -> Value { // BTreeMap<String, Value> fn build_default_header() -> Value { // BTreeMap<String, Value>
let mut m = BTreeMap::new(); let mut m = BTreeMap::new();