From 4bd38180d0ddb60ff512095c31f5aff7b2104095 Mon Sep 17 00:00:00 2001
From: _ <>
Date: Sun, 20 Dec 2020 18:23:17 +0000
Subject: [PATCH] :recycle: refactor: remove lifetime on handlebars
---
crates/ptth_file_server_bin/src/main.rs | 2 +-
crates/ptth_server/src/file_server/mod.rs | 4 ++--
crates/ptth_server/src/lib.rs | 8 ++++----
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/crates/ptth_file_server_bin/src/main.rs b/crates/ptth_file_server_bin/src/main.rs
index 6cce5cb..bc666ac 100644
--- a/crates/ptth_file_server_bin/src/main.rs
+++ b/crates/ptth_file_server_bin/src/main.rs
@@ -33,7 +33,7 @@ use ptth_server::{
load_toml,
};
-async fn handle_all (req: Request
, state: Arc >)
+async fn handle_all (req: Request , state: Arc )
-> Result , anyhow::Error>
{
use std::str::FromStr;
diff --git a/crates/ptth_server/src/file_server/mod.rs b/crates/ptth_server/src/file_server/mod.rs
index 5252534..d98d395 100644
--- a/crates/ptth_server/src/file_server/mod.rs
+++ b/crates/ptth_server/src/file_server/mod.rs
@@ -61,9 +61,9 @@ pub struct Config {
pub file_server_root: Option ,
}
-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 ,
}
diff --git a/crates/ptth_server/src/lib.rs b/crates/ptth_server/src/lib.rs
index 4c95767..1152d14 100644
--- a/crates/ptth_server/src/lib.rs
+++ b/crates/ptth_server/src/lib.rs
@@ -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 ,
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: &Arc ,
wrapped_req: http_serde::WrappedRequest
) -> Result <(), ServerError>
{
@@ -121,7 +121,7 @@ async fn handle_one_req (
}
async fn handle_req_resp (
- state: &Arc >,
+ state: &Arc ,
req_resp: reqwest::Response
) -> Result <(), ServerError>
{