Run cargo fmt

Signed-off-by: baalajimaestro <me@baalajimaestro.me>
This commit is contained in:
baalajimaestro 2023-02-21 12:52:46 +05:30
parent 3c8aee3c09
commit 9eadd3b9c5
Signed by: baalajimaestro
GPG key ID: F93C394FE9BBAFD5

View file

@ -5,10 +5,10 @@ use actix_web::{
web::{Data, Query}, web::{Data, Query},
App, HttpResponse, HttpServer, Responder, App, HttpResponse, HttpServer, Responder,
}; };
use base64::{engine::general_purpose, Engine};
use mime::TEXT_HTML; use mime::TEXT_HTML;
use reqwest::{header::HeaderMap, Client}; use reqwest::{header::HeaderMap, Client};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use base64::{Engine, engine::general_purpose};
use std::env; use std::env;
use tera::{Context, Tera}; use tera::{Context, Tera};
@ -54,7 +54,12 @@ async fn paste_render(data: Data<Template>, paste: Query<Paste>) -> impl Respond
paste_content = "Paste ID Invalid".to_string(); paste_content = "Paste ID Invalid".to_string();
} else { } else {
let resp_struct: ResponseJSON = serde_json::from_str(&response_json).unwrap(); let resp_struct: ResponseJSON = serde_json::from_str(&response_json).unwrap();
paste_content = String::from_utf8(general_purpose::STANDARD.decode(resp_struct.content).unwrap()).unwrap(); paste_content = String::from_utf8(
general_purpose::STANDARD
.decode(resp_struct.content)
.unwrap(),
)
.unwrap();
} }
} else { } else {
paste_content = "Provide a Paste ID".to_string(); paste_content = "Provide a Paste ID".to_string();