From f33e53e51bf2f8d80a952858f4a5a9f329993c10 Mon Sep 17 00:00:00 2001 From: yggverse Date: Mon, 9 Dec 2024 14:33:51 +0200 Subject: [PATCH] remove extra tuple --- src/gio/file_output_stream.rs | 4 ++-- src/gio/memory_input_stream.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gio/file_output_stream.rs b/src/gio/file_output_stream.rs index 3eedc36..c4a1e2d 100644 --- a/src/gio/file_output_stream.rs +++ b/src/gio/file_output_stream.rs @@ -21,7 +21,7 @@ pub fn move_all_from_stream_async( usize, // bytes_total ), callback: ( - impl Fn((Bytes, usize)) + 'static, // on_chunk + impl Fn(Bytes, usize) + 'static, // on_chunk impl FnOnce(Result) + 'static, // on_complete ), ) { @@ -38,7 +38,7 @@ pub fn move_all_from_stream_async( let bytes_total = bytes_total + bytes.len(); // Callback chunk function - on_chunk((bytes.clone(), bytes_total)); + on_chunk(bytes.clone(), bytes_total); // Validate max size if let Some(bytes_total_limit) = bytes_total_limit { diff --git a/src/gio/memory_input_stream.rs b/src/gio/memory_input_stream.rs index aa67d48..1ab065f 100644 --- a/src/gio/memory_input_stream.rs +++ b/src/gio/memory_input_stream.rs @@ -19,7 +19,7 @@ pub fn from_stream_async( priority: Priority, bytes_in_chunk: usize, bytes_total_limit: usize, - on_chunk: impl Fn((Bytes, usize)) + 'static, + on_chunk: impl Fn(Bytes, usize) + 'static, on_complete: impl FnOnce(Result) + 'static, ) { move_all_from_stream_async( @@ -46,7 +46,7 @@ pub fn move_all_from_stream_async( usize, // bytes_total ), callback: ( - impl Fn((Bytes, usize)) + 'static, // on_chunk + impl Fn(Bytes, usize) + 'static, // on_chunk impl FnOnce(Result) + 'static, // on_complete ), ) { @@ -63,7 +63,7 @@ pub fn move_all_from_stream_async( let bytes_total = bytes_total + bytes.len(); // Callback chunk function - on_chunk((bytes.clone(), bytes_total)); + on_chunk(bytes.clone(), bytes_total); // Validate max size if bytes_total > bytes_total_limit {