cargo-fmt the src

Signed-off-by: Gunwant Jain <mail@wantguns.dev>
This commit is contained in:
Gunwant Jain
2022-01-18 16:18:22 +05:30
parent ce001c6a79
commit 78b4213c62
6 changed files with 14 additions and 5 deletions

View File

@@ -8,7 +8,9 @@ use crate::models::pretty::get_pretty_body;
use crate::models::pretty_syntax::PasteIdSyntax;
#[get("/p/<id_ext>", rank = 1)]
pub async fn pretty_retrieve_ext(id_ext: PasteIdSyntax<'_>) -> Option<Template> {
pub async fn pretty_retrieve_ext(
id_ext: PasteIdSyntax<'_>,
) -> Option<Template> {
let id = id_ext.get_fname();
let ext = id_ext.get_ext();

View File

@@ -16,5 +16,6 @@ pub async fn retrieve(id: PasteId<'_>) -> Option<File> {
pub async fn retrieve_ext(id_ext: PasteIdSyntax<'_>) -> Option<File> {
// let filename = format!("upload/{id}", id = id_ext.get_fname());
File::open(get_upload_dir().join(format!("{id}", id = id_ext.get_fname()))).ok()
File::open(get_upload_dir().join(format!("{id}", id = id_ext.get_fname())))
.ok()
}

View File

@@ -7,7 +7,9 @@ use std::{borrow::Cow, ffi::OsStr, path::PathBuf};
struct Static;
#[get("/static/<file..>")]
pub fn static_files(file: PathBuf) -> Option<(ContentType, Cow<'static, [u8]>)> {
pub fn static_files(
file: PathBuf,
) -> Option<(ContentType, Cow<'static, [u8]>)> {
let filename = file.display().to_string();
let asset = Static::get(&filename)?;