summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2023-01-15 18:12:00 +0200
committerLars Wirzenius <liw@liw.fi>2023-01-22 11:28:32 +0200
commite87a9335934a8e8317019e4ba13c8512be1dcb51 (patch)
tree348ce01fd141e744abf08fdb0aad8ad27cea09a3
parent4a8f87b12aa73b17c88dae2a4a4ba16dd21947af (diff)
downloadsubplot-e87a9335934a8e8317019e4ba13c8512be1dcb51.tar.gz
chore: compile YamlMetadata::new only for tests
YamlMetadata::new is only used in unit tests, so disable it when not testing. Sponsored-by: author
-rw-r--r--src/ast.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ast.rs b/src/ast.rs
index e638464..9e50af1 100644
--- a/src/ast.rs
+++ b/src/ast.rs
@@ -253,6 +253,7 @@ pub struct YamlMetadata {
}
impl YamlMetadata {
+ #[cfg(test)]
fn new(yaml_text: &str) -> Result<Self, Error> {
trace!("Parsing YAML");
let meta: Self = serde_yaml::from_str(yaml_text)?;