From 8baa0767a65727228aaeefaaf447a84d1aa2bea8 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Sun, 7 Jul 2024 00:59:16 +0100 Subject: [PATCH] chore: update actix-multipart to v0.7 --- Cargo.lock | 17 ++++++++--------- Cargo.toml | 3 +-- forms/multipart/src/main.rs | 4 +++- templating/minijinja/src/main.rs | 2 +- templating/tera/src/main.rs | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 57ffe87..72b1b35 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -244,14 +244,13 @@ dependencies = [ [[package]] name = "actix-multipart" -version = "0.6.2" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d974dd6c4f78d102d057c672dcf6faa618fafa9df91d44f9c466688fc1275a3a" +checksum = "d5118a26dee7e34e894f7e85aa0ee5080ae4c18bf03c0e30d49a80e418f00a53" dependencies = [ "actix-multipart-derive", "actix-utils", "actix-web", - "bytes 1.6.0", "derive_more", "futures-core", "futures-util", @@ -270,9 +269,9 @@ dependencies = [ [[package]] name = "actix-multipart-derive" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a0a77f836d869f700e5b47ac7c3c8b9c8bc82e4aec861954c6198abee3ebd4d" +checksum = "e11eb847f49a700678ea2fa73daeb3208061afa2b9d1a8527c03390f4c4a1c6b" dependencies = [ "darling 0.20.3", "parse-size", @@ -1748,7 +1747,7 @@ dependencies = [ "bitflags 2.4.1", "cexpr", "clang-sys", - "itertools 0.12.1", + "itertools 0.11.0", "lazy_static", "lazycell", "log", @@ -6164,7 +6163,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", - "itertools 0.12.1", + "itertools 0.11.0", "proc-macro2", "quote", "syn 2.0.48", @@ -8828,8 +8827,8 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 1.0.0", - "rand 0.8.5", + "cfg-if 0.1.10", + "rand 0.7.3", "static_assertions", ] diff --git a/Cargo.toml b/Cargo.toml index 7e0dc88..e3a8531 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -83,8 +83,7 @@ actix-cors = "0.7" actix-files = "0.6" actix-http = "3.5" actix-identity = "0.7" -actix-multipart = "0.6" -actix-multipart-derive = "0.6" +actix-multipart = "0.7" actix-protobuf = "0.10" actix-session = "0.9" actix-test = "0.1" diff --git a/forms/multipart/src/main.rs b/forms/multipart/src/main.rs index 12b949b..0b4869c 100644 --- a/forms/multipart/src/main.rs +++ b/forms/multipart/src/main.rs @@ -74,7 +74,9 @@ async fn save_file_manual(mut payload: Multipart) -> Result // iterate over multipart stream while let Some(mut field) = payload.try_next().await? { // A multipart/form-data stream has to contain `content_disposition` - let content_disposition = field.content_disposition(); + let Some(content_disposition) = field.content_disposition() else { + continue; + }; let filename = content_disposition .get_filename() diff --git a/templating/minijinja/src/main.rs b/templating/minijinja/src/main.rs index 06a1fe9..7e2c7c1 100644 --- a/templating/minijinja/src/main.rs +++ b/templating/minijinja/src/main.rs @@ -61,7 +61,7 @@ async fn index( }, ) } else { - tmpl_env.render("index.html", ()) + tmpl_env.render("index.html", minijinja::Value::UNDEFINED) } } diff --git a/templating/tera/src/main.rs b/templating/tera/src/main.rs index d076cdd..8b53318 100644 --- a/templating/tera/src/main.rs +++ b/templating/tera/src/main.rs @@ -15,7 +15,7 @@ async fn index( tmpl: web::Data, query: web::Query>, ) -> Result { - let s = if let Some(name) = query.get("name") { + let html = if let Some(name) = query.get("name") { // submitted form let mut ctx = tera::Context::new(); ctx.insert("name", name); @@ -27,7 +27,7 @@ async fn index( .map_err(|_| error::ErrorInternalServerError("Template error"))? }; - Ok(web::Html::new(s)) + Ok(web::Html::new(html)) } #[actix_web::main]