From ba32ab5290f3fe54e19d569af2d15e72f1c35a87 Mon Sep 17 00:00:00 2001 From: Leonora Tindall Date: Wed, 1 Mar 2023 15:24:28 -0600 Subject: [PATCH] Update to WG Upstream (#4) * Fix typo: pretter -> pretty * fix: corrected spelling of "minimalistic" * Fix various build warnings. --------- Co-authored-by: Jonas Geiler --- build.rs | 2 +- src/models/maybe_redirect.rs | 3 +++ src/routes/pretty_retrieve.rs | 6 +++--- src/routes/submit.rs | 2 +- templates/base.html.tera | 2 +- templates/index.html.tera | 2 +- 6 files changed, 10 insertions(+), 7 deletions(-) diff --git a/build.rs b/build.rs index 85070ac..c5c0c3b 100644 --- a/build.rs +++ b/build.rs @@ -1,7 +1,7 @@ use std::process::Command; fn main() { let output = Command::new("git") - .args(&["rev-parse", "HEAD"]) + .args(["rev-parse", "HEAD"]) .output() .unwrap(); let git_hash = String::from_utf8(output.stdout).unwrap(); diff --git a/src/models/maybe_redirect.rs b/src/models/maybe_redirect.rs index 91ff7f9..2377d4c 100644 --- a/src/models/maybe_redirect.rs +++ b/src/models/maybe_redirect.rs @@ -1,6 +1,9 @@ use rocket::{response::Redirect, Responder}; use rocket_dyn_templates::Template; +// Allowed LEV because Rocket doesn't let us box Responders like Redirect. +// See https://github.com/SergioBenitez/Rocket/issues/568 +#[allow(clippy::large_enum_variant)] #[derive(Responder)] pub enum MaybeRedirect { Redirect(Redirect), diff --git a/src/routes/pretty_retrieve.rs b/src/routes/pretty_retrieve.rs index 207965f..3be359d 100644 --- a/src/routes/pretty_retrieve.rs +++ b/src/routes/pretty_retrieve.rs @@ -14,7 +14,7 @@ use crate::models::response_wrapper::ResponseWrapper; #[get("/p/", rank = 2)] pub async fn pretty_retrieve(id: PasteId<'_>) -> ResponseWrapper