Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index fe4d9da..aa77edd 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -67,6 +67,22 @@ pub enum Flow {
Done,
}
+impl Flow {
+ pub fn to_done(self) -> Self {
+ match self {
+ Flow::Continue | Flow::Done => Flow::Done,
+ Flow::Err => Flow::Err,
+ }
+ }
+
+ pub fn to_continue(self) -> Self {
+ match self {
+ Flow::Continue | Flow::Done => Flow::Continue,
+ Flow::Err => Flow::Err,
+ }
+ }
+}
+
#[macro_export]
macro_rules! Walk {
{