diff --git a/src/server.rs b/src/server.rs index 501b933..b1d293b 100644 --- a/src/server.rs +++ b/src/server.rs @@ -253,7 +253,7 @@ impl Server { .boxed() } // If there was a routing error - Err(e) => async move { new_boilerplate(def_headers, req_headers, 404, e.into()).await }.boxed(), + Err(e) => new_boilerplate(def_headers, req_headers, 404, e.into()).boxed(), } })) } @@ -379,7 +379,7 @@ fn determine_compressor(accept_encoding: String) -> Option { // This loop reads the requested compressors and keeps track of whichever // one has the highest priority per our heuristic. - for val in accept_encoding.to_string().split(',') { + for val in accept_encoding.split(',') { let mut q: f64 = 1.0; // The compressor and q-value (if the latter is defined) diff --git a/src/utils.rs b/src/utils.rs index 172bf4d..3fbd1f6 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -538,21 +538,21 @@ impl Preferences { } Self { available_themes: themes, - theme: setting(&req, "theme"), - front_page: setting(&req, "front_page"), - layout: setting(&req, "layout"), - wide: setting(&req, "wide"), - show_nsfw: setting(&req, "show_nsfw"), - blur_nsfw: setting(&req, "blur_nsfw"), - use_hls: setting(&req, "use_hls"), - hide_hls_notification: setting(&req, "hide_hls_notification"), - autoplay_videos: setting(&req, "autoplay_videos"), - disable_visit_reddit_confirmation: setting(&req, "disable_visit_reddit_confirmation"), - comment_sort: setting(&req, "comment_sort"), - post_sort: setting(&req, "post_sort"), - subscriptions: setting(&req, "subscriptions").split('+').map(String::from).filter(|s| !s.is_empty()).collect(), - filters: setting(&req, "filters").split('+').map(String::from).filter(|s| !s.is_empty()).collect(), - hide_awards: setting(&req, "hide_awards"), + theme: setting(req, "theme"), + front_page: setting(req, "front_page"), + layout: setting(req, "layout"), + wide: setting(req, "wide"), + show_nsfw: setting(req, "show_nsfw"), + blur_nsfw: setting(req, "blur_nsfw"), + use_hls: setting(req, "use_hls"), + hide_hls_notification: setting(req, "hide_hls_notification"), + autoplay_videos: setting(req, "autoplay_videos"), + disable_visit_reddit_confirmation: setting(req, "disable_visit_reddit_confirmation"), + comment_sort: setting(req, "comment_sort"), + post_sort: setting(req, "post_sort"), + subscriptions: setting(req, "subscriptions").split('+').map(String::from).filter(|s| !s.is_empty()).collect(), + filters: setting(req, "filters").split('+').map(String::from).filter(|s| !s.is_empty()).collect(), + hide_awards: setting(req, "hide_awards"), } } }