From ede2b08039112d414d8719a9d060969292565ea7 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 27 Jan 2019 17:18:58 +0100 Subject: [PATCH] disco: Add a helper constructor for Feature. --- src/disco.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/disco.rs b/src/disco.rs index d61cf361..ee673b8f 100644 --- a/src/disco.rs +++ b/src/disco.rs @@ -34,6 +34,15 @@ attributes: [ var: String = "var" => required, ]); +impl Feature { + /// Create a new `` with the according `@var`. + pub fn new(var: &str) -> Feature { + Feature { + var: String::from(var) + } + } +} + /// Structure representing an `` element. #[derive(Debug, Clone)] pub struct Identity {