diff options
author | Ryan Leckey <ryan@launchbadge.com> | 2017-06-22 15:57:14 -0700 |
---|---|---|
committer | Ryan Leckey <ryan@launchbadge.com> | 2017-06-22 15:57:14 -0700 |
commit | 159bb52c595384fed44a2c669198d50f2a758a9a (patch) | |
tree | 6553ceed3e172115fe8e682bbfc286bf8fd0f004 /src/file/mod.rs | |
parent | a9eecf075cf01f15ef05fea3f1edaa189446d055 (diff) |
Remove `namespace` option for File
Diffstat (limited to 'src/file/mod.rs')
-rw-r--r-- | src/file/mod.rs | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/src/file/mod.rs b/src/file/mod.rs index 671f579..6c45cb7 100644 --- a/src/file/mod.rs +++ b/src/file/mod.rs @@ -16,9 +16,6 @@ pub struct File<T> { source: T, - /// Namespace to restrict configuration from the file - namespace: Option<String>, - /// Format of file (which dictates what driver to use). format: Option<FileFormat>, @@ -31,7 +28,6 @@ impl File<source::string::FileSourceString> { File { format: Some(format), required: true, - namespace: None, source: s.into(), } } @@ -42,7 +38,6 @@ impl File<source::file::FileSourceFile> { File { format: Some(format), required: true, - namespace: None, source: source::file::FileSourceFile::new(name), } } @@ -53,7 +48,6 @@ impl File<source::file::FileSourceFile> { File { format: None, required: true, - namespace: None, source: source::file::FileSourceFile::new(name), } } @@ -64,11 +58,6 @@ impl<T: FileSource> File<T> { self.required = required; self } - - pub fn namespace(mut self, namespace: &str) -> Self { - self.namespace = Some(namespace.into()); - self - } } impl<T: FileSource> Source for File<T> @@ -96,13 +85,11 @@ impl<T: FileSource> Source for File<T> }; // Parse the string using the given format - format - .parse(uri.as_ref(), &contents, self.namespace.as_ref()) - .map_err(|cause| { - ConfigError::FileParse { - uri: uri, - cause: cause, - } - }) + format.parse(uri.as_ref(), &contents).map_err(|cause| { + ConfigError::FileParse { + uri: uri, + cause: cause, + } + }) } } |