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:
Zeke Fast
2025-04-27 14:56:50 +02:00
parent fec6763b75
commit c77bf9d3db
2 changed files with 2 additions and 2 deletions

View File

@@ -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"))?;

View File

@@ -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();