Check that the writer is in the expected state.
(&self, expected: WriterState, operation: &str)
| 12 | impl<'w, W: Write> ChangeWriter<'w, W> { |
| 13 | /// Check that the writer is in the expected state. |
| 14 | pub(super) fn expect_state(&self, expected: WriterState, operation: &str) -> FormatResult<()> { |
| 15 | if self.state != expected { |
| 16 | return Err(FormatError::UnexpectedSection { |
| 17 | got: operation.to_string(), |
| 18 | expected: format!("state {}, but was {}", expected.name(), self.state.name()), |
| 19 | }); |
| 20 | } |
| 21 | Ok(()) |
| 22 | } |
| 23 | |
| 24 | /// Ensure that the required metadata sections (HEADER + DEPS) have been written. |
| 25 | pub(super) fn ensure_metadata_complete(&self) -> FormatResult<()> { |
no outgoing calls
no test coverage detected