Fix bug in is_success

This commit is contained in:
Emi Tatsuo 2020-12-14 20:33:22 -05:00
parent 8f0d76fa55
commit cd0c4c328d
Signed by: Emi
GPG key ID: 68FAB2E2E6DFC98B

View file

@ -180,8 +180,16 @@ impl Response {
}
/// True if the response is a SUCCESS (10) response
///
/// ```
/// # use kochab::Response;
/// let redir = Response::redirect_permanent("/");
/// assert!(!redir.is_success());
/// let success = Response::success_plain("Hello gemini!");
/// assert!(success.is_success());
/// ```
pub const fn is_success(&self) -> bool {
self.status == 10
self.status == 20
}
#[cfg_attr(feature="gemini_srv",allow(unused_variables))]