INNER CODE UNIT · Rust
Ok
steineggerlab/folddisco · lib/pdbtbx-cif/src/lib.rs:92
while let Ok(value) = parse_value(input) {
values.push(value);
}
let columns = loop_value.header.len();
if values.len() % columns == 0 {
loop_value.data = Vec::with_capacity(values.len() / columns);
let mut iter = values.into_iter().peekable();
while iter.peek().is_some() {
loop_value.data.push((&mut iter).take(columns).collect());
}
} else {
return Err(PDBError::new(
ErrorLevel::BreakingError,
"Loop has incorrect number of data items",
format!("A loop has to have a number of data items which is divisible by the amount of headers but here there are {} items left.", values.len() % columns),
Context::range(&start, input),
));