this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: error correction for 0 sized chunks

+6
+6
src/progress.rs
··· 30 30 fn from_str(s: &str) -> Result<Self, Self::Err> { 31 31 // Try to parse s as just a number 32 32 if let Ok(num) = s.parse::<usize>() { 33 + if num == 0 { 34 + return Err("Invalid number"); 35 + } 33 36 return Ok(ChunkSize { size_in_bytes: num }); 34 37 } 35 38 // Simplify so that we always assume base 2, regardless of whether we see ··· 48 51 "gb" => num * 1024 * 1024 * 1024, 49 52 _ => return Err("Invalid unit"), 50 53 }; 54 + if size_in_bytes == 0 { 55 + return Err("Invalid number"); 56 + } 51 57 52 58 Ok(ChunkSize { size_in_bytes }) 53 59 }