Remove builder pattern, we really dont need it here

This commit is contained in:
Matthias Beyer 2017-05-20 15:15:56 +02:00
parent bca30cc900
commit e8e4ec112b
3 changed files with 7 additions and 22 deletions

View file

@ -18,7 +18,6 @@ chrono = "0.3"
toml-query = "0.1"
lazy_static = "0.2"
toml = "0.4"
derive_builder = "0.4"
[dependencies.libimagerror]
path = "../libimagerror"

View file

@ -25,26 +25,6 @@ use datepath::accuracy::Accuracy;
use datepath::format::Format;
use datepath::result::Result;
/// A builder for the DatePath object which can then be used to compile a time definition into a
/// StoreId.
#[derive(Builder, Debug)]
#[builder(setter(prefix = "with"))]
pub struct DatePathCompilerBuilder {
/// The accuracy which should be used to compile the time definition.
///
/// For example a `Accuracy::Hour` will ignore the minute and second from the time definition,
/// a `Accuracy::Month` will ignore days, hours, minutes and seconds.
#[builder(default)]
accuracy : Accuracy,
/// The formatter which shall be used to compile the time specification.
#[builder(default)]
format : Format,
}
pub struct DatePathCompiler {
accuracy : Accuracy,
format : Format,
@ -52,6 +32,13 @@ pub struct DatePathCompiler {
impl DatePathCompiler {
pub fn new(accuracy: Accuracy, format: Format) -> DatePathCompiler {
DatePathCompiler {
accuracy : accuracy,
format : format,
}
}
/// Compile a NaiveDateTime object into a StoreId object.
///
/// # More information

View file

@ -18,7 +18,6 @@
//
#[macro_use] extern crate lazy_static;
#[macro_use] extern crate derive_builder;
extern crate chrono;
extern crate toml_query;
extern crate toml;