return bytes total on_complete

This commit is contained in:
yggverse 2024-12-09 14:50:31 +02:00
parent f33e53e51b
commit 1911b0ad95
2 changed files with 7 additions and 7 deletions

View file

@ -21,8 +21,8 @@ pub fn move_all_from_stream_async(
usize, // bytes_total
),
callback: (
impl Fn(Bytes, usize) + 'static, // on_chunk
impl FnOnce(Result<FileOutputStream, Error>) + 'static, // on_complete
impl Fn(Bytes, usize) + 'static, // on_chunk
impl FnOnce(Result<(FileOutputStream, usize), Error>) + 'static, // on_complete
),
) {
let (on_chunk, on_complete) = callback;
@ -49,7 +49,7 @@ pub fn move_all_from_stream_async(
// No bytes were read, end of stream
if bytes.len() == 0 {
return on_complete(Ok(file_output_stream));
return on_complete(Ok((file_output_stream, bytes_total)));
}
// Write chunk bytes