mirror of
https://github.com/dnlbauer/xdrfile.git
synced 2026-09-11 06:35:30 +00:00
Broke out next_inner
This commit is contained in:
12
src/lib.rs
12
src/lib.rs
@@ -216,9 +216,9 @@ impl Trajectory for XTCTrajectory {
|
||||
fn read(&mut self, frame: &mut Frame) -> Result<()> {
|
||||
let mut step: i32 = 0;
|
||||
|
||||
let num_atoms = self
|
||||
.get_num_atoms()
|
||||
.map_err(|e| Error::CouldNotCheckNAtoms(Box::new(e)))? as usize;
|
||||
let num_atoms =
|
||||
self.get_num_atoms()
|
||||
.map_err(|e| Error::CheckNAtomsDuringRead(Box::new(e)))? as usize;
|
||||
if num_atoms != frame.coords.len() {
|
||||
Err((&*frame, num_atoms))?;
|
||||
}
|
||||
@@ -335,9 +335,9 @@ impl Trajectory for TRRTrajectory {
|
||||
let mut step: i32 = 0;
|
||||
let mut lambda: f32 = 0.0;
|
||||
|
||||
let num_atoms = self
|
||||
.get_num_atoms()
|
||||
.map_err(|e| Error::CouldNotCheckNAtoms(Box::new(e)))? as usize;
|
||||
let num_atoms =
|
||||
self.get_num_atoms()
|
||||
.map_err(|e| Error::CheckNAtomsDuringRead(Box::new(e)))? as usize;
|
||||
if num_atoms != frame.coords.len() {
|
||||
Err((&*frame, num_atoms))?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user