Update deps

This commit is contained in:
asonix 2023-06-01 16:19:17 -05:00
parent 9195d5623c
commit 1be6074cf4
6 changed files with 98 additions and 8 deletions

2
.gitignore vendored
View file

@ -2,3 +2,5 @@
**/*.rs.bk
Cargo.lock
/examples/filename*.png
/.envrc
/.direnv

View file

@ -1,7 +1,7 @@
[package]
name = "actix-form-data"
description = "Multipart Form Data for Actix Web"
version = "0.7.0-beta.0"
version = "0.7.0-beta.1"
license = "GPL-3.0"
authors = ["asonix <asonix@asonix.dog>"]
repository = "https://git.asonix.dog/asonix/actix-form-data.git"
@ -10,7 +10,7 @@ keywords = ["actix", "form-data", "multipart", "async"]
edition = "2021"
[dependencies]
actix-multipart = "0.4.0"
actix-multipart = { version = "0.6.0", default-features = false }
actix-rt = "2.5.0"
actix-web = { version = "4.0.0", default-features = false }
futures-util = "0.3.17"

61
flake.lock Normal file
View file

@ -0,0 +1,61 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1685518550,
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1685564631,
"narHash": "sha256-8ywr3AkblY4++3lIVxmrWZFzac7+f32ZEhH/A8pNscI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4f53efe34b3a8877ac923b9350c874e3dcd5dc0a",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

27
flake.nix Normal file
View file

@ -0,0 +1,27 @@
{
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
in
{
packages.default = pkgs.hello;
devShell = with pkgs; mkShell {
nativeBuildInputs = [ cargo cargo-outdated cargo-zigbuild clippy gcc protobuf rust-analyzer rustc rustfmt ];
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
};
formatter = pkgs.nixpkgs-fmt;
});
}

View file

@ -32,7 +32,7 @@ use tracing::trace;
#[derive(Debug)]
pub struct FileMeta<T> {
pub filename: String,
pub content_type: Mime,
pub content_type: Option<Mime>,
pub result: T,
}
@ -155,7 +155,7 @@ impl<T> From<MultipartContent<T>> for Value<T> {
pub type FileFn<T, E> = Box<
dyn Fn(
String,
Mime,
Option<Mime>,
Pin<Box<dyn Stream<Item = Result<Bytes, Error>>>>,
) -> Pin<Box<dyn Future<Output = Result<T, E>>>>
>;
@ -215,7 +215,7 @@ impl<T, E> Field<T, E> {
/// ```
pub fn file<F, Fut>(f: F) -> Self
where
F: Fn(String, Mime, Pin<Box<dyn Stream<Item = Result<Bytes, Error>>>>) -> Fut
F: Fn(String, Option<Mime>, Pin<Box<dyn Stream<Item = Result<Bytes, Error>>>>) -> Fut
+ Clone
+ 'static,
Fut: Future<Output = Result<T, E>> + 'static,
@ -437,8 +437,8 @@ impl<T, E> Map<T, E> {
Some(NamePart::Map(name_part)) => self
.inner
.iter()
.find(|&&(ref item, _)| *item == *name_part)
.and_then(|&(_, ref field)| field.valid_field(name)),
.find(|(ref item, _)| *item == *name_part)
.and_then(|(_, ref field)| field.valid_field(name)),
_ => None,
}
}

View file

@ -117,7 +117,7 @@ where
let file_size = Arc::new(AtomicUsize::new(0));
let content_type = field.content_type().clone();
let content_type = field.content_type().cloned();
let max_file_size = form.max_file_size;