mirror of
https://gitlab.com/keys.openpgp.org/hagrid.git
synced 2025-10-06 00:23:08 +02:00
Clean up linting warnings: deref coersion related.
Commands: cargo clippy --tests --no-deps --workspace Warnings: warning: called `.as_ref().map(|f| f.as_path())` on an `Option` value --> tester/src/main.rs:78:13 | 78 | output_fprs.as_ref().map(|f| f.as_path()), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref: `output_fprs.as_deref()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_as_ref_deref = note: `#[warn(clippy::option_as_ref_deref)]` on by default warning: deref which would be done by auto-deref --> src/web/vks_web.rs:358:52 | 358 | for ValueField { name, value } in Form::values(&*String::from_utf8_lossy(&buf)) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&String::from_utf8_lossy(&buf)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref = note: `#[warn(clippy::explicit_auto_deref)]` on by default
This commit is contained in:
@@ -355,7 +355,7 @@ pub async fn process_post_form(
|
||||
// application/x-www-form-urlencoded
|
||||
let buf = data.open(UPLOAD_LIMIT).into_bytes().await?;
|
||||
|
||||
for ValueField { name, value } in Form::values(&*String::from_utf8_lossy(&buf)) {
|
||||
for ValueField { name, value } in Form::values(&String::from_utf8_lossy(&buf)) {
|
||||
let decoded_value = percent_decode(value.as_bytes())
|
||||
.decode_utf8()
|
||||
.map_err(|_| anyhow!("`Content-Type: application/x-www-form-urlencoded` not valid"))?;
|
||||
|
@@ -75,7 +75,7 @@ fn main() -> Result<()> {
|
||||
generate::do_generate(
|
||||
count,
|
||||
output_certs.as_path(),
|
||||
output_fprs.as_ref().map(|f| f.as_path()),
|
||||
output_fprs.as_deref(),
|
||||
)?;
|
||||
} else if let Some(matches) = matches.subcommand_matches("gen-reqs") {
|
||||
let host = matches.value_of("host").unwrap();
|
||||
|
Reference in New Issue
Block a user