Compare commits

...

4 commits
0.19.0 ... main

Author SHA1 Message Date
yggverse
11d17e004e update version 2025-11-07 21:15:20 +02:00
yggverse
bba51e38e8 apply fmt updates 2025-10-19 22:46:49 +03:00
yggverse
0f6eaa563c update version 2025-10-19 22:38:51 +03:00
yggverse
7e9ecf64b3 implement default trait 2025-10-19 22:37:48 +03:00
4 changed files with 25 additions and 5 deletions

View file

@ -1,6 +1,6 @@
[package]
name = "ggemini"
version = "0.19.0"
version = "0.20.1"
edition = "2024"
license = "MIT"
readme = "README.md"

View file

@ -33,11 +33,11 @@ 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 {
if let Some(limit) = size.limit
&& size.total > limit
{
return on_complete(Err(Error::BytesTotal(size.total, limit)));
}
}
if bytes.is_empty() {
return on_complete(Ok((file_output_stream, size.total)));

View file

@ -5,3 +5,13 @@ pub struct Size {
pub limit: Option<usize>,
pub total: usize,
}
impl Default for Size {
fn default() -> Self {
Self {
chunk: 0x10000, // 64KB
limit: None,
total: 0,
}
}
}

View file

@ -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,
}
}
}