diff --git a/gotham_restful/src/result.rs b/gotham_restful/src/result.rs index ef258a4..22c819e 100644 --- a/gotham_restful/src/result.rs +++ b/gotham_restful/src/result.rs @@ -251,6 +251,25 @@ pub enum AuthResult AuthErr } +impl AuthResult +{ + pub fn is_ok(&self) -> bool + { + match self { + Self::Ok(_) => true, + _ => false + } + } + + pub fn unwrap(self) -> T + { + match self { + Self::Ok(data) => data, + _ => panic!() + } + } +} + impl From for AuthResult { fn from(t : T) -> Self