mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-04-02 01:55:35 +00:00
return bytes total on_complete
This commit is contained in:
parent
f33e53e51b
commit
1911b0ad95
2 changed files with 7 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue