Apply clippy suggestions

Use the latest rust version

Signed-off-by: Gunwant Jain <mail@wantguns.dev>
This commit is contained in:
Gunwant Jain
2022-03-15 14:03:08 +05:30
parent efc1a9df58
commit 0305742d6d
2 changed files with 3 additions and 3 deletions

View File

@@ -31,7 +31,7 @@ pub async fn pretter_retrieve_inner(
id: &str, id: &str,
ext: &str, ext: &str,
) -> ResponseWrapper<Template> { ) -> ResponseWrapper<Template> {
let filepath = Path::new(&get_upload_dir()).join(id.to_string()); let filepath = Path::new(&get_upload_dir()).join(id);
let modified_date = let modified_date =
match fs::metadata(&filepath).and_then(|m| m.modified()) { match fs::metadata(&filepath).and_then(|m| m.modified()) {

View File

@@ -15,11 +15,11 @@ pub async fn retrieve(id: PasteId<'_>) -> ResponseWrapper<File> {
// rank 1 here because this would be more oftenly used // rank 1 here because this would be more oftenly used
#[get("/<id_ext>", rank = 1)] #[get("/<id_ext>", rank = 1)]
pub async fn retrieve_ext(id_ext: PasteIdSyntax<'_>) -> ResponseWrapper<File> { pub async fn retrieve_ext(id_ext: PasteIdSyntax<'_>) -> ResponseWrapper<File> {
retrieve_inner(&id_ext.get_fname().to_string()).await retrieve_inner(id_ext.get_fname()).await
} }
pub async fn retrieve_inner(id: &str) -> ResponseWrapper<File> { pub async fn retrieve_inner(id: &str) -> ResponseWrapper<File> {
let filepath = Path::new(&get_upload_dir()).join(id.to_string()); let filepath = Path::new(&get_upload_dir()).join(id);
let modified_date = let modified_date =
match std::fs::metadata(&filepath).and_then(|m| m.modified()) { match std::fs::metadata(&filepath).and_then(|m| m.modified()) {