ezidam: minor stuff
This commit is contained in:
parent
a3866b0af2
commit
bb3e4dfd40
3 changed files with 16 additions and 4 deletions
|
|
@ -13,3 +13,6 @@ erased-serde = "0.3"
|
|||
# local crates
|
||||
database_pool = { path = "../database_pool" }
|
||||
settings = { path = "../settings" }
|
||||
users = { path = "../users" }
|
||||
id = { path = "../id" }
|
||||
hash = { path = "../hash" }
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ use erased_serde::Serialize;
|
|||
|
||||
pub enum Page {
|
||||
Error(Error),
|
||||
Setup(),
|
||||
Setup,
|
||||
Homepage(Homepage),
|
||||
}
|
||||
|
||||
|
|
@ -16,7 +16,7 @@ impl Page {
|
|||
fn template_name(&self) -> &'static str {
|
||||
match self {
|
||||
Page::Error(_) => "error",
|
||||
Page::Setup() => "setup",
|
||||
Page::Setup => "setup",
|
||||
Page::Homepage(_) => "homepage",
|
||||
}
|
||||
}
|
||||
|
|
@ -25,7 +25,7 @@ impl Page {
|
|||
fn page_title(&self) -> &'static str {
|
||||
match self {
|
||||
Page::Error(_) => "Error",
|
||||
Page::Setup() => "Setup",
|
||||
Page::Setup => "Setup",
|
||||
Page::Homepage(_) => "Home",
|
||||
}
|
||||
}
|
||||
|
|
@ -34,7 +34,7 @@ impl Page {
|
|||
fn content(self) -> Box<dyn Serialize> {
|
||||
match self {
|
||||
Page::Error(error) => Box::new(error),
|
||||
Page::Setup() => Box::new(()),
|
||||
Page::Setup => Box::new(()),
|
||||
Page::Homepage(homepage) => Box::new(homepage),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,16 @@ pub(self) mod prelude {
|
|||
pub use crate::database::Database;
|
||||
pub use crate::error::Error;
|
||||
pub use crate::file_from_bytes::FileFromBytes;
|
||||
pub use crate::guards::*;
|
||||
pub use crate::page::Page;
|
||||
pub use hash::Password;
|
||||
pub use id::UserID;
|
||||
pub use rocket::form::Form;
|
||||
pub use rocket::response::Redirect;
|
||||
pub use rocket::tokio::task;
|
||||
pub use rocket::FromForm;
|
||||
pub use rocket::{routes, uri, Either, Route};
|
||||
pub use rocket_db_pools::sqlx::Acquire;
|
||||
pub use rocket_db_pools::Connection;
|
||||
|
||||
pub type Result<T> = std::result::Result<T, Error>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue