diff --git a/src/gio/file_output_stream.rs b/src/gio/file_output_stream.rs index 777600f..2dffb5e 100644 --- a/src/gio/file_output_stream.rs +++ b/src/gio/file_output_stream.rs @@ -33,10 +33,10 @@ pub fn from_stream_async( size.total += bytes.len(); on_chunk(bytes.clone(), size.total); - if let Some(limit) = size.limit { - if size.total > limit { - return on_complete(Err(Error::BytesTotal(size.total, limit))); - } + if let Some(limit) = size.limit + && size.total > limit + { + return on_complete(Err(Error::BytesTotal(size.total, limit))); } if bytes.is_empty() {