mirror of
https://git.asonix.dog/asonix/pict-rs
synced 2024-12-22 11:21:24 +00:00
Update to latest actix-form-data
This commit is contained in:
parent
4e3b2a22a8
commit
acba660c37
3 changed files with 5 additions and 15 deletions
6
Cargo.lock
generated
6
Cargo.lock
generated
|
@ -20,9 +20,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "actix-form-data"
|
||||
version = "0.6.0-beta.8"
|
||||
version = "0.6.0-beta.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "304d237617d707993b9210dfaa2c5243ac8bcda5ed1b7a5b6f3b404a4f31a2f3"
|
||||
checksum = "ac713cbe809a8627fd8af30292b2881080d8d008559330f4e49f039800a963ed"
|
||||
dependencies = [
|
||||
"actix-multipart",
|
||||
"actix-rt",
|
||||
|
@ -1007,7 +1007,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "pict-rs"
|
||||
version = "0.3.0-alpha.31"
|
||||
version = "0.3.0-alpha.32"
|
||||
dependencies = [
|
||||
"actix-form-data",
|
||||
"actix-rt",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
name = "pict-rs"
|
||||
description = "A simple image hosting service"
|
||||
version = "0.3.0-alpha.31"
|
||||
version = "0.3.0-alpha.32"
|
||||
authors = ["asonix <asonix@asonix.dog>"]
|
||||
license = "AGPL-3.0"
|
||||
readme = "README.md"
|
||||
|
|
12
src/error.rs
12
src/error.rs
|
@ -55,7 +55,7 @@ impl From<sled::transaction::TransactionError<Error>> for Error {
|
|||
#[derive(Debug, thiserror::Error)]
|
||||
pub(crate) enum UploadError {
|
||||
#[error("Couln't upload file, {0}")]
|
||||
Upload(String),
|
||||
Upload(#[from] actix_form_data::Error),
|
||||
|
||||
#[error("Error in DB, {0}")]
|
||||
Db(#[from] sled::Error),
|
||||
|
@ -130,16 +130,6 @@ impl From<awc::error::SendRequestError> for UploadError {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<actix_form_data::Error<Error>> for Error {
|
||||
fn from(e: actix_form_data::Error<Error>) -> Self {
|
||||
if let actix_form_data::Error::FileFn(e) = e {
|
||||
return e;
|
||||
}
|
||||
|
||||
UploadError::Upload(e.to_string()).into()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<actix_web::error::BlockingError> for UploadError {
|
||||
fn from(_: actix_web::error::BlockingError) -> Self {
|
||||
UploadError::Canceled
|
||||
|
|
Loading…
Reference in a new issue