From c95ff86e2c8fbdd8e0cf6550aadc7ffc676dcc16 Mon Sep 17 00:00:00 2001 From: seancarroll Date: Wed, 6 Jan 2021 21:11:57 -0600 Subject: trying to organize files and use declarations --- src/attributes/direction.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/attributes/direction.rs (limited to 'src/attributes/direction.rs') diff --git a/src/attributes/direction.rs b/src/attributes/direction.rs new file mode 100644 index 0000000..bebc3c0 --- /dev/null +++ b/src/attributes/direction.rs @@ -0,0 +1,20 @@ +use crate::dot::DotString; +use std::borrow::Cow; + +pub enum Direction { + Forward, + Back, + Both, + None, +} + +impl<'a> DotString<'a> for Direction { + fn dot_string(&self) -> Cow<'a, str> { + match self { + Direction::Forward => "forward".into(), + Direction::Back => "back".into(), + Direction::Both => "both".into(), + Direction::None => "none".into(), + } + } +} -- cgit v1.2.3