From e93a177b255626f1dfcf3b38d41e43da70bd76cc Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Tue, 6 Aug 2024 20:15:40 +0400 Subject: [PATCH] feat: add Response::is_ok --- src/response.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/response.rs b/src/response.rs index d0384eb..c33b792 100644 --- a/src/response.rs +++ b/src/response.rs @@ -21,6 +21,11 @@ impl Response { } } + #[inline] + pub fn is_ok(self: &Self) -> bool { + self.status.reply_type() == ReplyType::Success + } + pub fn ensure_ok(self: Self) -> Result { if self.status.reply_type() == ReplyType::Success { Ok(self)