(&mut self, count: usize, field: &str)
| 323 | } |
| 324 | |
| 325 | fn put_count(&mut self, count: usize, field: &str) -> Result<(), OperationCodecError> { |
| 326 | if count > MAX_OPERATION_COLLECTION_ITEMS { |
| 327 | return Err(OperationCodecError::new(format!( |
| 328 | "{field} has {count} items, maximum is {MAX_OPERATION_COLLECTION_ITEMS}" |
| 329 | ))); |
| 330 | } |
| 331 | let count = u32::try_from(count) |
| 332 | .map_err(|_| OperationCodecError::new(format!("{field} count exceeds u32")))?; |
| 333 | self.put_u32(count) |
| 334 | } |
| 335 | |
| 336 | fn put_string(&mut self, value: &str, field: &str) -> Result<(), OperationCodecError> { |
| 337 | if value.is_empty() { |
no test coverage detected