Adding clippy:unwrap to husky. Fixes #1892 (#1893)

This commit is contained in:
Dessalines 2021-11-11 07:18:08 -05:00 committed by GitHub
parent 8a108bccae
commit 8d4c4fdf6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 -- \
-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
git add config/defaults.hjson

View file

@ -69,7 +69,10 @@ impl Guard for InboxRequestGuard {
return false;
}
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
}