Resolve clippy::try_err warnings

This commit is contained in:
Konrad Borowski 2019-11-27 20:03:08 +01:00
parent a8ee83739d
commit 69920c316f

View File

@ -75,13 +75,13 @@ pub fn insert(
.ok_or_else(|| warp::reject::custom(CustomRejection::UnrecognizedLanguageIdentifier))?; .ok_or_else(|| warp::reject::custom(CustomRejection::UnrecognizedLanguageIdentifier))?;
for (field, name) in &[(&paste, "paste"), (&stdin, "stdin")] { for (field, name) in &[(&paste, "paste"), (&stdin, "stdin")] {
if field.len() > 1_000_000 { if field.len() > 1_000_000 {
Err(warp::reject::custom(CustomRejection::FieldTooLarge(name)))?; return Err(warp::reject::custom(CustomRejection::FieldTooLarge(name)));
} }
} }
for (field, name) in &[(&stdout, "stdout"), (&stderr, "stderr")] { for (field, name) in &[(&stdout, "stdout"), (&stderr, "stderr")] {
if let Some(field) = field { if let Some(field) = field {
if field.len() > 1_000_000 { if field.len() > 1_000_000 {
Err(warp::reject::custom(CustomRejection::FieldTooLarge(name)))?; return Err(warp::reject::custom(CustomRejection::FieldTooLarge(name)));
} }
} }
} }