Update to WG Upstream (#4)
* Fix typo: pretter -> pretty * fix: corrected spelling of "minimalistic" * Fix various build warnings. --------- Co-authored-by: Jonas Geiler <skayo.dev@gmail.com>
This commit is contained in:
parent
fdf38d4e55
commit
ba32ab5290
6 changed files with 10 additions and 7 deletions
2
build.rs
2
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();
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ use crate::models::response_wrapper::ResponseWrapper;
|
|||
|
||||
#[get("/p/<id>", rank = 2)]
|
||||
pub async fn pretty_retrieve(id: PasteId<'_>) -> ResponseWrapper<Template> {
|
||||
pretter_retrieve_inner(&id.to_string(), "txt").await
|
||||
pretty_retrieve_inner(&id.to_string(), "txt").await
|
||||
}
|
||||
|
||||
#[get("/p/<id_ext>", rank = 1)]
|
||||
|
|
@ -24,10 +24,10 @@ pub async fn pretty_retrieve_ext(
|
|||
let id = id_ext.get_fname();
|
||||
let ext = id_ext.get_ext();
|
||||
|
||||
pretter_retrieve_inner(id, ext).await
|
||||
pretty_retrieve_inner(id, ext).await
|
||||
}
|
||||
|
||||
pub async fn pretter_retrieve_inner(
|
||||
pub async fn pretty_retrieve_inner(
|
||||
id: &str,
|
||||
ext: &str,
|
||||
) -> ResponseWrapper<Template> {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ pub async fn submit(paste: Form<PasteIdForm>) -> Redirect {
|
|||
let content = &paste.content;
|
||||
let ext = &paste.ext;
|
||||
|
||||
fs::write(&filepath, content).expect("Unable to write to the file");
|
||||
fs::write(filepath, content).expect("Unable to write to the file");
|
||||
|
||||
Redirect::to(format!("/p/{id}.{ext}", id = id, ext = ext))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="Description" content="Author: Gunwant Jain,
|
||||
A highly opinionated and minamalistic Pastebin." />
|
||||
A highly opinionated and minimalistic Pastebin." />
|
||||
|
||||
<link rel="apple-touch-icon" href="/static/media/apple-touch-icon.png" />
|
||||
<link rel="icon" type="image/png" sizes="192x192" href="/static/media/android-chrome-192x192.png" />
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
bin(3) BIN bin(3)
|
||||
|
||||
NAME
|
||||
bin - A highly opinionated and minamalistic Pastebin
|
||||
bin - A highly opinionated and minimalistic Pastebin
|
||||
|
||||
ROUTES
|
||||
GET /
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue