Adding clippy:unwrap to husky. Fixes #1892

add_clippy_unwrap_husky
Dessalines 2021-11-10 18:09:15 -05:00
parent 8a108bccae
commit 11dab9c6f5
2 changed files with 6 additions and 1 deletions

View File

@ -5,6 +5,8 @@ cargo +nightly fmt -- --check
cargo clippy --workspace --tests --all-targets --all-features -- \ cargo clippy --workspace --tests --all-targets --all-features -- \
-D warnings -D deprecated -D clippy::perf -D clippy::complexity -D clippy::dbg_macro -D warnings -D deprecated -D clippy::perf -D clippy::complexity -D clippy::dbg_macro
cargo clippy --workspace -- \
-D clippy::unwrap_used
./scripts/update_config_defaults.sh ./scripts/update_config_defaults.sh
git add config/defaults.hjson git add config/defaults.hjson

View File

@ -69,7 +69,10 @@ impl Guard for InboxRequestGuard {
return false; return false;
} }
if let Some(val) = request.headers.get("Content-Type") { if let Some(val) = request.headers.get("Content-Type") {
return val.to_str().unwrap().starts_with("application/"); return val
.to_str()
.expect("Content-Type header contains non-ascii chars.")
.starts_with("application/");
} }
false false
} }