From 7e9ecf64b3c5e456f739413892d14b0c5c83dda2 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sun, 19 Oct 2025 22:37:48 +0300 Subject: [PATCH 1/4] implement default trait --- src/gio/file_output_stream/size.rs | 10 ++++++++++ src/gio/memory_input_stream/size.rs | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/gio/file_output_stream/size.rs b/src/gio/file_output_stream/size.rs index 285d9f1..5d0c911 100644 --- a/src/gio/file_output_stream/size.rs +++ b/src/gio/file_output_stream/size.rs @@ -5,3 +5,13 @@ pub struct Size { pub limit: Option, pub total: usize, } + +impl Default for Size { + fn default() -> Self { + Self { + chunk: 0x10000, // 64KB + limit: None, + total: 0, + } + } +} diff --git a/src/gio/memory_input_stream/size.rs b/src/gio/memory_input_stream/size.rs index b95ef39..9a10bd3 100644 --- a/src/gio/memory_input_stream/size.rs +++ b/src/gio/memory_input_stream/size.rs @@ -4,3 +4,13 @@ pub struct Size { pub limit: usize, pub total: usize, } + +impl Default for Size { + fn default() -> Self { + Self { + chunk: 0x10000, // 64KB + limit: 0xfffff, // 1 MB + total: 0, + } + } +} From 0f6eaa563c428f85ecd49c9f562b2987b6fed317 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sun, 19 Oct 2025 22:38:51 +0300 Subject: [PATCH 2/4] update version --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 901e1b7..12c3c6c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ggemini" -version = "0.19.0" +version = "0.20.0" edition = "2024" license = "MIT" readme = "README.md" From bba51e38e831cc84060c901e1dbe2e6efa0823ad Mon Sep 17 00:00:00 2001 From: yggverse Date: Sun, 19 Oct 2025 22:46:49 +0300 Subject: [PATCH 3/4] apply fmt updates --- src/gio/file_output_stream.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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() { From 11d17e004e473354bc0d9ca9ae701af6cd281ee7 Mon Sep 17 00:00:00 2001 From: yggverse Date: Fri, 7 Nov 2025 21:15:20 +0200 Subject: [PATCH 4/4] update version --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 12c3c6c..801fb2e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ggemini" -version = "0.20.0" +version = "0.20.1" edition = "2024" license = "MIT" readme = "README.md"