summaryrefslogtreecommitdiffstats
path: root/src/file/format/mod.rs
diff options
context:
space:
mode:
authorRyan Leckey <ryan@launchbadge.com>2017-06-13 17:36:41 -0700
committerRyan Leckey <ryan@launchbadge.com>2017-06-13 17:36:45 -0700
commit3fdb2a3a19bc0248763d2bf15a152b8661534a82 (patch)
treeff5cf5cf263b1b65635ff875b4bb8d6ab18b5f9a /src/file/format/mod.rs
parent3c3d1e860eded0027f1efe3bb25e0fa6fa8b8940 (diff)
Add YAML
Diffstat (limited to 'src/file/format/mod.rs')
-rw-r--r--src/file/format/mod.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/file/format/mod.rs b/src/file/format/mod.rs
index c9b1012..02cafe7 100644
--- a/src/file/format/mod.rs
+++ b/src/file/format/mod.rs
@@ -9,8 +9,8 @@ mod toml;
#[cfg(feature = "json")]
mod json;
-// #[cfg(feature = "yaml")]
-// mod yaml;
+#[cfg(feature = "yaml")]
+mod yaml;
#[derive(Debug, Clone, Copy)]
pub enum FileFormat {
@@ -22,9 +22,9 @@ pub enum FileFormat {
#[cfg(feature = "json")]
Json,
- // /// YAML (parsed with yaml_rust)
- // #[cfg(feature = "yaml")]
- // Yaml,
+ /// YAML (parsed with yaml_rust)
+ #[cfg(feature = "yaml")]
+ Yaml,
}
impl FileFormat {
@@ -38,8 +38,8 @@ impl FileFormat {
#[cfg(feature = "json")]
FileFormat::Json => vec!["json"],
- // #[cfg(feature = "yaml")]
- // FileFormat::Yaml => vec!["yaml", "yml"],
+ #[cfg(feature = "yaml")]
+ FileFormat::Yaml => vec!["yaml", "yml"],
}
}
@@ -54,8 +54,8 @@ impl FileFormat {
#[cfg(feature = "json")]
FileFormat::Json => json::parse(uri, text, namespace),
- // #[cfg(feature = "yaml")]
- // FileFormat::Yaml => yaml::Content::parse(text, namespace),
+ #[cfg(feature = "yaml")]
+ FileFormat::Yaml => yaml::parse(uri, text, namespace),
}
}
}