make status optional

This commit is contained in:
yggverse 2024-10-23 10:59:02 +03:00
parent ef64e7e032
commit 35e0e2d47d

View File

@ -264,7 +264,7 @@ impl Page {
match response.header().status() { match response.header().status() {
// 10 | 11 // 10 | 11
ResponseStatus::Input | ResponseStatus::SensitiveInput => { Some(ResponseStatus::Input) | Some(ResponseStatus::SensitiveInput) => {
// Format response // Format response
let status = Status::Input; let status = Status::Input;
let title = gformat!("Input expected"); let title = gformat!("Input expected");
@ -278,7 +278,7 @@ impl Page {
// Make input form // Make input form
match response.header().status() { match response.header().status() {
ResponseStatus::SensitiveInput => Some(ResponseStatus::SensitiveInput) =>
input.set_new_sensitive( input.set_new_sensitive(
action_page_open, uri, action_page_open, uri,
Some(&description), Some(&description),
@ -301,7 +301,7 @@ impl Page {
action_update.activate(Some(&id)); action_update.activate(Some(&id));
}, },
// 20 // 20
ResponseStatus::Success => Some(ResponseStatus::Success) =>
match response.header().mime() { match response.header().mime() {
Some(ResponseMime::TextGemini) => { Some(ResponseMime::TextGemini) => {
// Update data // Update data
@ -378,7 +378,7 @@ impl Page {
}, },
}, },
// 32 // 32
ResponseStatus::Redirect => { Some(ResponseStatus::Redirect) => {
// Update meta // Update meta
meta.borrow_mut().status = Some(Status::Redirect); meta.borrow_mut().status = Some(Status::Redirect);
meta.borrow_mut().title = Some(gformat!("Redirect")); meta.borrow_mut().title = Some(gformat!("Redirect"));
@ -404,7 +404,7 @@ impl Page {
} }
}, },
// @TODO // @TODO
_ => { None => {
// Define common data // Define common data
let status = Status::Failure; let status = Status::Failure;
let title = gformat!("Oops"); let title = gformat!("Oops");