MCPcopy Create free account
hub / github.com/YuminosukeSato/ironkernel / require_non_empty

Method require_non_empty

src/buffer/inner.rs:150–158  ·  view source on GitHub ↗

Validate buffer is non-empty, returning error if empty.

(&self, op: &str)

Source from the content-addressed store, hash-verified

148
149 /// Validate buffer is non-empty, returning error if empty.
150 pub fn require_non_empty(&self, op: &str) -> ParsecResult<()> {
151 if self.is_empty() {
152 Err(ParsecError::EmptyCollection(format!(
153 "cannot {op} empty buffer"
154 )))
155 } else {
156 Ok(())
157 }
158 }
159}
160
161#[cfg(test)]

Callers 2

eval_reduceFunction · 0.80

Calls 1

is_emptyMethod · 0.80

Tested by 1