diff options
Diffstat (limited to 'src/file/mod.rs')
-rw-r--r-- | src/file/mod.rs | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/file/mod.rs b/src/file/mod.rs index 45deb92..6586ede 100644 --- a/src/file/mod.rs +++ b/src/file/mod.rs @@ -12,7 +12,8 @@ pub use self::format::FileFormat; #[derive(Clone, Debug)] pub struct File<T> - where T: FileSource +where + T: FileSource, { source: T, @@ -86,8 +87,9 @@ impl<T: FileSource> File<T> { } impl<T: FileSource> Source for File<T> - where T: 'static, - T: Sync + Send +where + T: 'static, + T: Sync + Send, { fn clone_into_box(&self) -> Box<Source + Send + Sync> { Box::new((*self).clone()) @@ -96,8 +98,9 @@ impl<T: FileSource> Source for File<T> fn collect(&self) -> Result<HashMap<String, Value>> { // Coerce the file contents to a string let (uri, contents, format) = match self.source - .resolve(self.format) - .map_err(|err| ConfigError::Foreign(err)) { + .resolve(self.format) + .map_err(|err| ConfigError::Foreign(err)) + { Ok((uri, contents, format)) => (uri, contents, format), Err(error) => { @@ -111,10 +114,10 @@ impl<T: FileSource> Source for File<T> // Parse the string using the given format format.parse(uri.as_ref(), &contents).map_err(|cause| { - ConfigError::FileParse { - uri: uri, - cause: cause, - } - }) + ConfigError::FileParse { + uri: uri, + cause: cause, + } + }) } } |