Skip to content

Commit

Permalink
Fix a bug in Atom::from_str method
Browse files Browse the repository at this point in the history
  • Loading branch information
ybyygu committed Mar 19, 2024
1 parent 46645bf commit 6f913de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/atom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ impl FromStr for Atom {

let mut atom = Atom::new(sym, [px, py, pz]);
// HACK: parse velocities
if nparts >= 6 {
if nparts > 6 {
let vxyz: Vec<_> = parts[4..7].iter().filter_map(|x| x.parse().ok()).collect();
if vxyz.len() == 3 {
atom.velocity = [vxyz[0], vxyz[1], vxyz[2]].into();
Expand Down

0 comments on commit 6f913de

Please sign in to comment.