mirror of
https://github.com/danbulant/Portfolio
synced 2026-07-04 18:40:47 +00:00
fix: data guard variable names
This commit is contained in:
parent
493e3a3077
commit
9722282163
2 changed files with 5 additions and 5 deletions
|
|
@ -35,7 +35,7 @@ impl<'r> FromData<'r> for Letter {
|
||||||
let is_pdf = portfolio_core::filetype::filetype_is_pdf(&data_bytes);
|
let is_pdf = portfolio_core::filetype::filetype_is_pdf(&data_bytes);
|
||||||
|
|
||||||
if !is_pdf {
|
if !is_pdf {
|
||||||
// TODO: Not ZIP
|
// TODO: Not PDF
|
||||||
}
|
}
|
||||||
|
|
||||||
Outcome::Success(Letter(data_bytes))
|
Outcome::Success(Letter(data_bytes))
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,9 @@ impl<'r> FromData<'r> for Portfolio {
|
||||||
type Error = Option<String>;
|
type Error = Option<String>;
|
||||||
|
|
||||||
async fn from_data(req: &'r Request<'_>, data: Data<'r>) -> data::Outcome<'r, Self> {
|
async fn from_data(req: &'r Request<'_>, data: Data<'r>) -> data::Outcome<'r, Self> {
|
||||||
let content_type_pdf = ContentType::new("application", "application/zip");
|
let content_type_zip = ContentType::new("application", "application/zip");
|
||||||
|
|
||||||
if req.content_type() != Some(&content_type_pdf) {
|
if req.content_type() != Some(&content_type_zip) {
|
||||||
return Outcome::Failure((Status::BadRequest, None))
|
return Outcome::Failure((Status::BadRequest, None))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -32,9 +32,9 @@ impl<'r> FromData<'r> for Portfolio {
|
||||||
|
|
||||||
let data_bytes = data_bytes.into_inner();
|
let data_bytes = data_bytes.into_inner();
|
||||||
|
|
||||||
let is_pdf = portfolio_core::filetype::filetype_is_zip(&data_bytes);
|
let is_zip = portfolio_core::filetype::filetype_is_zip(&data_bytes);
|
||||||
|
|
||||||
if !is_pdf {
|
if !is_zip {
|
||||||
// TODO: Not ZIP
|
// TODO: Not ZIP
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue