mirror of https://github.com/spikecodes/libreddit
Formatting + clippy changes (#12)
Co-authored-by: Matthew Esposito <matt@matthew.science>
This commit is contained in:
parent
238ef73ed4
commit
a0db2144a5
|
@ -27,7 +27,7 @@ async fn stream(url: &str, req: &Request<Body>) -> Result<Response<Body>, String
|
|||
let https = hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_only().enable_http1().build();
|
||||
|
||||
// Build the hyper client from the HTTPS connector.
|
||||
let client: client::Client<_, hyper::Body> = client::Client::builder().build(https);
|
||||
let client: client::Client<_, Body> = client::Client::builder().build(https);
|
||||
|
||||
let mut builder = Request::get(uri);
|
||||
|
||||
|
@ -67,7 +67,7 @@ fn request(url: String, quarantine: bool) -> Boxed<Result<Response<Body>, String
|
|||
let https = hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build();
|
||||
|
||||
// Construct the hyper client from the HTTPS connector.
|
||||
let client: client::Client<_, hyper::Body> = client::Client::builder().build(https);
|
||||
let client: client::Client<_, Body> = client::Client::builder().build(https);
|
||||
|
||||
// Build request
|
||||
let builder = Request::builder()
|
||||
|
|
|
@ -131,7 +131,7 @@ impl Route<'_> {
|
|||
|
||||
impl Server {
|
||||
pub fn new() -> Self {
|
||||
Server {
|
||||
Self {
|
||||
default_headers: HeaderMap::new(),
|
||||
router: Router::new(),
|
||||
}
|
||||
|
|
|
@ -257,11 +257,7 @@ pub async fn subscriptions_filters(req: Request<Body>) -> Result<Response<Body>,
|
|||
|
||||
// Redirect back to subreddit
|
||||
// check for redirect parameter if unsubscribing/unfiltering from outside sidebar
|
||||
let path = if let Some(redirect_path) = param(&format!("?{}", query), "redirect") {
|
||||
format!("/{}", redirect_path)
|
||||
} else {
|
||||
format!("/r/{}", sub)
|
||||
};
|
||||
let path = param(&format!("?{}", query), "redirect").map_or_else(|| format!("/r/{}", sub), |redirect_path| format!("/{}", redirect_path));
|
||||
|
||||
let mut response = redirect(path);
|
||||
|
||||
|
|
|
@ -469,7 +469,7 @@ impl Preferences {
|
|||
let mut themes = vec!["system".to_string()];
|
||||
for file in ThemeAssets::iter() {
|
||||
let chunks: Vec<&str> = file.as_ref().split(".css").collect();
|
||||
themes.push(chunks[0].to_owned())
|
||||
themes.push(chunks[0].to_owned());
|
||||
}
|
||||
Self {
|
||||
available_themes: themes,
|
||||
|
|
Loading…
Reference in New Issue