🚨 Add license to Cargo.toml and fix up clippy stuff

main
_ 2020-10-31 21:59:02 -05:00
parent b673fa94c7
commit 063e79d217
4 changed files with 7 additions and 10 deletions

View File

@ -2,8 +2,10 @@
name = "ptth" name = "ptth"
version = "0.1.0" version = "0.1.0"
authors = ["_"] authors = ["Trish"]
edition = "2018" edition = "2018"
license-file = "COPYING"
license = "AGPL-3.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -73,8 +73,8 @@ async fn handle_all (req: Request <Body>, state: Arc <ServerState <'static>>)
} }
let body = ptth_resp.body let body = ptth_resp.body
.map (|b| Body::wrap_stream (b)) .map (Body::wrap_stream)
.unwrap_or_else (|| Body::empty ()) .unwrap_or_else (Body::empty)
; ;
let resp = resp.body (body).unwrap (); let resp = resp.body (body).unwrap ();

View File

@ -247,10 +247,7 @@ pub async fn serve_all (
} }
} }
let should_send_body = match &parts.method { let should_send_body = matches! (&parts.method, http_serde::Method::Get);
http_serde::Method::Get => true,
_ => false,
};
use percent_encoding::*; use percent_encoding::*;

View File

@ -97,9 +97,7 @@ pub async fn main (opt: Opt) -> Result <(), Box <dyn Error>> {
let handlebars = handlebars.clone (); let handlebars = handlebars.clone ();
tokio::spawn (async move { tokio::spawn (async move {
match handle_req_resp (&opt, handlebars, &client, req_resp).await { handle_req_resp (&opt, handlebars, &client, req_resp).await;
_ => (),
}
}); });
} }
} }