Update deps
This commit is contained in:
parent
9195d5623c
commit
1be6074cf4
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -2,3 +2,5 @@
|
||||||
**/*.rs.bk
|
**/*.rs.bk
|
||||||
Cargo.lock
|
Cargo.lock
|
||||||
/examples/filename*.png
|
/examples/filename*.png
|
||||||
|
/.envrc
|
||||||
|
/.direnv
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "actix-form-data"
|
name = "actix-form-data"
|
||||||
description = "Multipart Form Data for Actix Web"
|
description = "Multipart Form Data for Actix Web"
|
||||||
version = "0.7.0-beta.0"
|
version = "0.7.0-beta.1"
|
||||||
license = "GPL-3.0"
|
license = "GPL-3.0"
|
||||||
authors = ["asonix <asonix@asonix.dog>"]
|
authors = ["asonix <asonix@asonix.dog>"]
|
||||||
repository = "https://git.asonix.dog/asonix/actix-form-data.git"
|
repository = "https://git.asonix.dog/asonix/actix-form-data.git"
|
||||||
|
@ -10,7 +10,7 @@ keywords = ["actix", "form-data", "multipart", "async"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix-multipart = "0.4.0"
|
actix-multipart = { version = "0.6.0", default-features = false }
|
||||||
actix-rt = "2.5.0"
|
actix-rt = "2.5.0"
|
||||||
actix-web = { version = "4.0.0", default-features = false }
|
actix-web = { version = "4.0.0", default-features = false }
|
||||||
futures-util = "0.3.17"
|
futures-util = "0.3.17"
|
||||||
|
|
61
flake.lock
Normal file
61
flake.lock
Normal 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
27
flake.nix
Normal 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;
|
||||||
|
});
|
||||||
|
}
|
10
src/types.rs
10
src/types.rs
|
@ -32,7 +32,7 @@ use tracing::trace;
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct FileMeta<T> {
|
pub struct FileMeta<T> {
|
||||||
pub filename: String,
|
pub filename: String,
|
||||||
pub content_type: Mime,
|
pub content_type: Option<Mime>,
|
||||||
pub result: T,
|
pub result: T,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ impl<T> From<MultipartContent<T>> for Value<T> {
|
||||||
pub type FileFn<T, E> = Box<
|
pub type FileFn<T, E> = Box<
|
||||||
dyn Fn(
|
dyn Fn(
|
||||||
String,
|
String,
|
||||||
Mime,
|
Option<Mime>,
|
||||||
Pin<Box<dyn Stream<Item = Result<Bytes, Error>>>>,
|
Pin<Box<dyn Stream<Item = Result<Bytes, Error>>>>,
|
||||||
) -> Pin<Box<dyn Future<Output = Result<T, E>>>>
|
) -> 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
|
pub fn file<F, Fut>(f: F) -> Self
|
||||||
where
|
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
|
+ Clone
|
||||||
+ 'static,
|
+ 'static,
|
||||||
Fut: Future<Output = Result<T, E>> + 'static,
|
Fut: Future<Output = Result<T, E>> + 'static,
|
||||||
|
@ -437,8 +437,8 @@ impl<T, E> Map<T, E> {
|
||||||
Some(NamePart::Map(name_part)) => self
|
Some(NamePart::Map(name_part)) => self
|
||||||
.inner
|
.inner
|
||||||
.iter()
|
.iter()
|
||||||
.find(|&&(ref item, _)| *item == *name_part)
|
.find(|(ref item, _)| *item == *name_part)
|
||||||
.and_then(|&(_, ref field)| field.valid_field(name)),
|
.and_then(|(_, ref field)| field.valid_field(name)),
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,7 +117,7 @@ where
|
||||||
|
|
||||||
let file_size = Arc::new(AtomicUsize::new(0));
|
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;
|
let max_file_size = form.max_file_size;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue