♻️ refactor: remove lifetime on handlebars
parent
88c3500fd0
commit
4bd38180d0
|
@ -33,7 +33,7 @@ use ptth_server::{
|
|||
load_toml,
|
||||
};
|
||||
|
||||
async fn handle_all (req: Request <Body>, state: Arc <State <'static>>)
|
||||
async fn handle_all (req: Request <Body>, state: Arc <State>)
|
||||
-> Result <Response <Body>, anyhow::Error>
|
||||
{
|
||||
use std::str::FromStr;
|
||||
|
|
|
@ -61,9 +61,9 @@ pub struct Config {
|
|||
pub file_server_root: Option <PathBuf>,
|
||||
}
|
||||
|
||||
pub struct State <'a> {
|
||||
pub struct State {
|
||||
pub config: Config,
|
||||
pub handlebars: handlebars::Handlebars <'a>,
|
||||
pub handlebars: handlebars::Handlebars <'static>,
|
||||
pub instance_metrics: metrics::Startup,
|
||||
pub hidden_path: Option <PathBuf>,
|
||||
}
|
||||
|
|
|
@ -51,8 +51,8 @@ pub fn password_is_bad (mut password: String) -> bool {
|
|||
ac.find (BAD_PASSWORDS).is_some ()
|
||||
}
|
||||
|
||||
struct State <'a> {
|
||||
file_server: file_server::State <'a>,
|
||||
struct State {
|
||||
file_server: file_server::State,
|
||||
config: Config,
|
||||
gauges: RwLock <file_server::metrics::Gauges>,
|
||||
client: Client,
|
||||
|
@ -62,7 +62,7 @@ struct State <'a> {
|
|||
// When file_server responds, wrap it back up and stream it to the relay.
|
||||
|
||||
async fn handle_one_req (
|
||||
state: &Arc <State <'static>>,
|
||||
state: &Arc <State>,
|
||||
wrapped_req: http_serde::WrappedRequest
|
||||
) -> Result <(), ServerError>
|
||||
{
|
||||
|
@ -121,7 +121,7 @@ async fn handle_one_req (
|
|||
}
|
||||
|
||||
async fn handle_req_resp (
|
||||
state: &Arc <State <'static>>,
|
||||
state: &Arc <State>,
|
||||
req_resp: reqwest::Response
|
||||
) -> Result <(), ServerError>
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue