Skip to content

Commit

Permalink
Fixed fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
SarthakSingh31 committed Jul 25, 2020
1 parent 8fcc94c commit 151f638
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/config/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub struct Config {
/// Any structs that impl this trait can be consumed by ConfigBuilder to make
/// build a config
pub trait ConfigBuildable {
/// Unwraps the stuct into structs the builder can build from
fn builder_unwrap(self) -> (Option<ConfigBuilder>, Root);
}

Expand Down Expand Up @@ -60,11 +61,14 @@ impl Config {
}

impl ConfigBuildable for Config {
fn builder_unwrap(self) -> (Option<ConfigBuilder>, Root) {
fn builder_unwrap(self) -> (Option<ConfigBuilder>, Root) {
(
Some(ConfigBuilder{ appenders: self.appenders, loggers: self.loggers }),
self.root
)
Some(ConfigBuilder {
appenders: self.appenders,
loggers: self.loggers,
}),
self.root,
)
}
}

Expand Down Expand Up @@ -181,7 +185,10 @@ impl ConfigBuilder {

let (config, errors) = if let Some(config_builder) = config_builder {
self.combine(config_builder)
} else { self }.build_lossy(root);
} else {
self
}
.build_lossy(root);

if errors.is_empty() {
Ok(config)
Expand Down Expand Up @@ -221,7 +228,7 @@ impl Root {
}

impl ConfigBuildable for Root {
fn builder_unwrap(self) -> (Option<ConfigBuilder>, Root) {
fn builder_unwrap(self) -> (Option<ConfigBuilder>, Root) {
(None, self)
}
}
Expand Down

0 comments on commit 151f638

Please sign in to comment.