(&self, n: usize)
| 57 | } |
| 58 | |
| 59 | fn add_bytes<E>(&self, n: usize) -> Result<(), E> |
| 60 | where |
| 61 | E: de::Error, |
| 62 | { |
| 63 | self.bytes.set(self.bytes.get() + n); |
| 64 | if self.bytes.get() > MAX_YAML_BYTES { |
| 65 | return Err(E::custom(format!( |
| 66 | "YAML body expands to more than {MAX_YAML_BYTES} bytes" |
| 67 | ))); |
| 68 | } |
| 69 | Ok(()) |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | struct BoundedVisitor<'a> { |