2
0
Fork 0
mirror of https://git.asonix.dog/asonix/pict-rs synced 2024-12-23 03:41:23 +00:00

Update to latest actix-form-data

This commit is contained in:
Aode (Lion) 2021-09-13 20:50:51 -05:00
parent 4e3b2a22a8
commit acba660c37
3 changed files with 5 additions and 15 deletions

6
Cargo.lock generated
View file

@ -20,9 +20,9 @@ dependencies = [
[[package]] [[package]]
name = "actix-form-data" 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" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "304d237617d707993b9210dfaa2c5243ac8bcda5ed1b7a5b6f3b404a4f31a2f3" checksum = "ac713cbe809a8627fd8af30292b2881080d8d008559330f4e49f039800a963ed"
dependencies = [ dependencies = [
"actix-multipart", "actix-multipart",
"actix-rt", "actix-rt",
@ -1007,7 +1007,7 @@ dependencies = [
[[package]] [[package]]
name = "pict-rs" name = "pict-rs"
version = "0.3.0-alpha.31" version = "0.3.0-alpha.32"
dependencies = [ dependencies = [
"actix-form-data", "actix-form-data",
"actix-rt", "actix-rt",

View file

@ -1,7 +1,7 @@
[package] [package]
name = "pict-rs" name = "pict-rs"
description = "A simple image hosting service" description = "A simple image hosting service"
version = "0.3.0-alpha.31" version = "0.3.0-alpha.32"
authors = ["asonix <asonix@asonix.dog>"] authors = ["asonix <asonix@asonix.dog>"]
license = "AGPL-3.0" license = "AGPL-3.0"
readme = "README.md" readme = "README.md"

View file

@ -55,7 +55,7 @@ impl From<sled::transaction::TransactionError<Error>> for Error {
#[derive(Debug, thiserror::Error)] #[derive(Debug, thiserror::Error)]
pub(crate) enum UploadError { pub(crate) enum UploadError {
#[error("Couln't upload file, {0}")] #[error("Couln't upload file, {0}")]
Upload(String), Upload(#[from] actix_form_data::Error),
#[error("Error in DB, {0}")] #[error("Error in DB, {0}")]
Db(#[from] sled::Error), 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 { impl From<actix_web::error::BlockingError> for UploadError {
fn from(_: actix_web::error::BlockingError) -> Self { fn from(_: actix_web::error::BlockingError) -> Self {
UploadError::Canceled UploadError::Canceled