From 493d99f0ed36d63589ed3f94445ab0ddea0ce377 Mon Sep 17 00:00:00 2001 From: "Aode (lion)" Date: Mon, 22 Nov 2021 18:21:10 -0600 Subject: [PATCH] Update to latest beta --- Cargo.toml | 8 ++++---- src/types.rs | 9 --------- src/upload.rs | 11 +++++------ 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1a2dc29..a3ccf8c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "actix-form-data" description = "Multipart Form Data for Actix Web" -version = "0.6.0-beta.10" +version = "0.6.0-beta.11" license = "GPL-3.0" authors = ["asonix "] repository = "https://git.asonix.dog/Aardwolf/actix-form-data.git" @@ -10,9 +10,9 @@ keywords = ["actix", "form-data", "multipart", "async"] edition = "2021" [dependencies] -actix-multipart = "0.4.0-beta.7" -actix-rt = "2.3.0" -actix-web = { version = "4.0.0-beta.10", default-features = false } +actix-multipart = "0.4.0-beta.8" +actix-rt = "2.5.0" +actix-web = { version = "4.0.0-beta.11", default-features = false } futures-util = "0.3.17" mime = "0.3.16" thiserror = "1.0" diff --git a/src/types.rs b/src/types.rs index 10e19cc..fb1dd50 100644 --- a/src/types.rs +++ b/src/types.rs @@ -614,15 +614,6 @@ pub(crate) struct ContentDisposition { pub filename: Option, } -impl ContentDisposition { - pub(crate) fn empty() -> Self { - ContentDisposition { - name: None, - filename: None, - } - } -} - #[derive(Clone, Debug, PartialEq)] pub(crate) enum NamePart { Map(String), diff --git a/src/upload.rs b/src/upload.rs index 10d45b5..98e3af5 100644 --- a/src/upload.rs +++ b/src/upload.rs @@ -90,12 +90,11 @@ fn parse_multipart_name(name: String) -> Result, Error> { } fn parse_content_disposition(field: &actix_multipart::Field) -> ContentDisposition { - match field.content_disposition() { - Some(x) => ContentDisposition { - name: x.get_name().map(|v| v.to_string()), - filename: x.get_filename().map(|v| v.to_string()), - }, - None => ContentDisposition::empty(), + let content_disposition = field.content_disposition(); + + ContentDisposition { + name: content_disposition.get_name().map(|v| v.to_string()), + filename: content_disposition.get_filename().map(|v| v.to_string()), } }