src: cargo clippy and fmt the project

Signed-off-by: Gunwant Jain <mail@wantguns.dev>
This commit is contained in:
Gunwant Jain
2022-01-20 03:44:01 +05:30
parent 3ed972e672
commit 689db9548a
5 changed files with 12 additions and 11 deletions

View File

@@ -14,7 +14,7 @@ pub async fn pretty_retrieve_ext(
let id = id_ext.get_fname();
let ext = id_ext.get_ext();
let filepath = Path::new(&get_upload_dir()).join(format!("{id}", id = id));
let filepath = Path::new(&get_upload_dir()).join(id.to_string());
let contents = get_pretty_body(&filepath, &ext.to_string());

View File

@@ -16,6 +16,5 @@ 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(id_ext.get_fname().to_string())).ok()
}