mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-04-01 17:45:35 +00:00
use reference without copy usize
This commit is contained in:
parent
02ced24cce
commit
4ab83702e9
1 changed files with 3 additions and 3 deletions
|
|
@ -34,7 +34,7 @@ pub fn from_socket_connection_async(
|
||||||
priority: Priority,
|
priority: Priority,
|
||||||
bytes_in_chunk: usize,
|
bytes_in_chunk: usize,
|
||||||
bytes_total_limit: usize,
|
bytes_total_limit: usize,
|
||||||
on_chunk: Option<impl Fn((&Bytes, usize)) + 'static>,
|
on_chunk: Option<impl Fn((&Bytes, &usize)) + 'static>,
|
||||||
on_complete: Option<impl FnOnce(Result<MemoryInputStream, (Error, Option<&str>)>) + 'static>,
|
on_complete: Option<impl FnOnce(Result<MemoryInputStream, (Error, Option<&str>)>) + 'static>,
|
||||||
) {
|
) {
|
||||||
read_all_from_socket_connection_async(
|
read_all_from_socket_connection_async(
|
||||||
|
|
@ -82,7 +82,7 @@ pub fn read_all_from_socket_connection_async(
|
||||||
bytes_in_chunk: usize,
|
bytes_in_chunk: usize,
|
||||||
bytes_total_limit: usize,
|
bytes_total_limit: usize,
|
||||||
bytes_total: usize,
|
bytes_total: usize,
|
||||||
on_chunk: Option<impl Fn((&Bytes, usize)) + 'static>,
|
on_chunk: Option<impl Fn((&Bytes, &usize)) + 'static>,
|
||||||
on_complete: Option<impl FnOnce(Result<MemoryInputStream, (Error, Option<&str>)>) + 'static>,
|
on_complete: Option<impl FnOnce(Result<MemoryInputStream, (Error, Option<&str>)>) + 'static>,
|
||||||
) {
|
) {
|
||||||
socket_connection.input_stream().read_bytes_async(
|
socket_connection.input_stream().read_bytes_async(
|
||||||
|
|
@ -96,7 +96,7 @@ pub fn read_all_from_socket_connection_async(
|
||||||
|
|
||||||
// Callback chunk function
|
// Callback chunk function
|
||||||
if let Some(ref callback) = on_chunk {
|
if let Some(ref callback) = on_chunk {
|
||||||
callback((&bytes, bytes_total));
|
callback((&bytes, &bytes_total));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate max size
|
// Validate max size
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue