Fix bug in is_success
This commit is contained in:
parent
8f0d76fa55
commit
cd0c4c328d
|
@ -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))]
|
||||
|
|
Loading…
Reference in a new issue