diff options
author | Ryan Leckey <ryan@launchbadge.com> | 2017-06-22 14:14:29 -0700 |
---|---|---|
committer | Ryan Leckey <ryan@launchbadge.com> | 2017-06-22 14:30:51 -0700 |
commit | 2b438ed9b53fee5689032f3b5fcdda8d15becd5f (patch) | |
tree | 48374e66a6594c7d11d19fe38f7e23df731b52be /src/file/source/string.rs | |
parent | 04d3ee8f70337e4899932b92262fbeec2dbb1bd9 (diff) |
Add builder API to Config
Diffstat (limited to 'src/file/source/string.rs')
-rw-r--r-- | src/file/source/string.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/file/source/string.rs b/src/file/source/string.rs index 922e46c..70101d6 100644 --- a/src/file/source/string.rs +++ b/src/file/source/string.rs @@ -6,6 +6,7 @@ use source::Source; use super::{FileSource, FileFormat}; /// Describes a file sourced from a string +#[derive(Clone, Debug)] pub struct FileSourceString(String); impl<'a> From<&'a str> for FileSourceString { @@ -15,7 +16,9 @@ impl<'a> From<&'a str> for FileSourceString { } impl FileSource for FileSourceString { - fn resolve(&self, format_hint: Option<FileFormat>) -> Result<(Option<String>, String, FileFormat), Box<Error>> { + fn resolve(&self, + format_hint: Option<FileFormat>) + -> Result<(Option<String>, String, FileFormat), Box<Error>> { Ok((None, self.0.clone(), format_hint.expect("from_str requires a set file format"))) } } |