Count serialization through a bounded sink rather than allocating an unbounded JSON string for a single potentially enormous FileOps/GraphOp.
| 180 | // Count serialization through a bounded sink rather than allocating an unbounded |
| 181 | // JSON string for a single potentially enormous FileOps/GraphOp. |
| 182 | struct ByteBudget(usize); |
| 183 | impl Write for ByteBudget { |
| 184 | fn write(&mut self, bytes: &[u8]) -> io::Result<usize> { |
| 185 | if bytes.len() > self.0 { |
no outgoing calls
no test coverage detected