From 380d58a3c0f6637dea015223c0a510de6e857130 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 28 Oct 2015 19:21:22 +0100 Subject: [PATCH] Move header types/traits outside own module --- src/module/mod.rs | 52 ++++++++++++++++++++++------------------------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/src/module/mod.rs b/src/module/mod.rs index f935997b..c0d8f110 100644 --- a/src/module/mod.rs +++ b/src/module/mod.rs @@ -86,36 +86,32 @@ pub mod file { } } - pub mod header { + pub enum FileHeaderSpec { + Null, + Bool, + Integer, + UInteger, + Float, + Text, + Key { name: String, value_type: Box }, + Array { allowed_types: Box> }, + } - pub enum FileHeaderSpec { - Null, - Bool, - Integer, - UInteger, - Float, - Text, - Key { name: String, value_type: Box }, - Array { allowed_types: Box> }, - } - - pub enum FileHeaderData { - Null, - Bool(bool), - Integer(i64), - UInteger(u64), - Float(f64), - Text(String), - Key { name: String, value: Box }, - Array { values: Box> }, - } - - pub trait FileHeaderParser : Sized { - fn new(spec: &FileHeaderSpec) -> Self; - fn read(&self, string: &String) -> Result; - fn write(&self, data: &FileHeaderData) -> Result; - } + pub enum FileHeaderData { + Null, + Bool(bool), + Integer(i64), + UInteger(u64), + Float(f64), + Text(String), + Key { name: String, value: Box }, + Array { values: Box> }, + } + pub trait FileHeaderParser : Sized { + fn new(spec: &FileHeaderSpec) -> Self; + fn read(&self, string: &String) -> Result; + fn write(&self, data: &FileHeaderData) -> Result; } pub trait FileData : Sized {