Blob::size -> Blob::length

Signed-off-by: Alexey Aristov <aav@acm.org>
This commit is contained in:
Alexey Aristov
2025-08-28 15:24:59 +02:00
parent 6fbca2fedc
commit a22f4f4d9c
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -19,7 +19,7 @@ use crate::handlers::{ApiError, HandlerResult};
pub struct Blob {
pub s3_key: String,
pub size: u64,
pub length: u64,
pub inline: Option<Vec<u8>>,
}
@@ -74,7 +74,7 @@ async fn upload_regular(
.await
.map_err(|_| actix_web::error::ErrorPayloadTooLarge("payload too large"))??;
let size = payload.len() as u64;
let length = payload.len() as u64;
let inline = if require_inline {
Some(payload.to_vec())
} else {
@@ -110,7 +110,7 @@ async fn upload_regular(
Ok(Blob {
s3_key,
size,
length,
inline,
})
}
@@ -237,7 +237,7 @@ async fn upload_multipart(
Ok(Blob {
s3_key,
size: total_uploaded as u64,
length: total_uploaded as u64,
inline: None,
})
}
+2 -2
View File
@@ -136,7 +136,7 @@ pub async fn put(request: HttpRequest, payload: Payload) -> HandlerResult<HttpRe
key: path.key,
part: 0,
blob: uploaded.s3_key,
size: uploaded.size,
size: uploaded.length,
etag: ksuid::Ksuid::generate().to_base62(),
headers: Some(headers.clone().into_iter().collect()),
meta: Some(meta.into_iter().collect()),
@@ -191,7 +191,7 @@ pub async fn post(request: HttpRequest, payload: Payload) -> HandlerResult<HttpR
key: path.key,
part,
blob: uploaded.s3_key,
size: uploaded.size,
size: uploaded.length,
etag: ksuid::Ksuid::generate().to_base62(),
headers: None,
meta: None,