// Some of these properties probably could be allowed to change,
// but it's not important enough for me to look into them right now,
// so we simply check that they don't change.
Some of these properties probably could be allowed to change,
but it's not important enough for me to look into them right now,
so we simply check that they don't change.
Some of these properties probably could be allowed to change but it ' s not important enough for me to look into them right now so we simply check that they don ' t change .
fn check_data_set_in_stone(&self, coords: &Coords, meta: &P::Meta) -> FailResult<()>
    {Ok({
        // struct acting as a generic closure
        struct Closure<'a, P: Potential> {
            lmp: &'a Lammps<P>,
            coords: &'a Coords,
        }
        impl<'a, P: Potential + 'a> Closure<'a, P> {
            fn check<D>(&self, msg: &'static str, was: D, now: D) -> FailResult<()>
            where D: fmt::Debug + PartialEq,
            {
                let Closure { lmp, coords } = *self;
                if was != now {
                    if let Some(mut file) = lmp.create_debug_dir_file("lammps-wrap-debug-carts") {
                        let _ = writeln!(file, "{:?}", coords.to_carts());
                    }
                    bail!("{} changed since build()\n was: {:?}\n now: {:?}", msg, was, now);
                }
                Ok(())
            }
        }
        let InitInfo { masses, pair_style, pair_coeffs } = self.potential.init_info(coords, meta);
        let molecule_ids = self.potential.molecule_ids(coords, meta);
        let Lammps {
            original_num_atoms,
            original_init_info: InitInfo {
                masses: ref original_masses,
                pair_style: ref original_pair_style,
                pair_coeffs: ref original_pair_coeffs,
            },
            ref original_molecule_ids,
            ..
        } = *self;
        let c = Closure { lmp: self, coords };
        c.check("number of atom types has", original_masses.len(), masses.len())?;
        c.check("number of atoms has", original_num_atoms, coords.num_atoms())?;
        c.check("masses have", original_masses, &masses)?;
        c.check("molecule ids have", original_molecule_ids, &molecule_ids)?;
        c.check("pair_style command has", original_pair_style, &pair_style)?;
        c.check("pair_coeff commands have", original_pair_coeffs, &pair_coeffs)?;
    })}
fn check_data_set_in_stone ( & self , coords : & Coords , meta : & P :: Meta ) -> FailResult < ( ) > { Ok ( { // struct acting as a generic closure struct Closure < ' a , P : Potential > { lmp : & ' a Lammps < P > , coords : & ' a Coords , } impl < ' a , P : Potential + ' a > Closure < ' a , P > { fn check < D > ( & self , msg : & ' static str , was : D , now : D ) -> FailResult < ( ) > where D : fmt :: Debug + PartialEq , { let Closure { lmp , coords } = * self ; if was != now { if let Some ( mut file ) = lmp . create_debug_dir_file ( " " ) { let _ = writeln ! ( file " " coords to_carts ( ) ) ; } bail ! ( " \n \n " msg was now ) ; } Ok ( ( ) ) } } let InitInfo { masses , pair_style , pair_coeffs } = self . potential . init_info ( coords , meta ) ; let molecule_ids = self . potential . molecule_ids ( coords , meta ) ; let Lammps { original_num_atoms , original_init_info : InitInfo { masses : ref original_masses , pair_style : ref original_pair_style , pair_coeffs : ref original_pair_coeffs , } , ref original_molecule_ids , .. } = * self ; let c = Closure { lmp : self , coords } ; c . check ( " " , original_masses . len ( ) , masses . len ( ) ) ? ; c . check ( " " , original_num_atoms , coords . num_atoms ( ) ) ? ; c . check ( " " , original_masses , & masses ) ? ; c . check ( " " , original_molecule_ids , & molecule_ids ) ? ; c . check ( " " , original_pair_style , & pair_style ) ? ; c . check ( " " , original_pair_coeffs , & pair_coeffs ) ? ; } ) }
Some of these properties probably could be allowed to change,
but it's not important enough for me to look into them right now,
so we simply check that they don't change.
Some of these properties probably could be allowed to change but it ' s not important enough for me to look into them right now so we simply check that they don ' t change .
&self
coords
&Coords
meta
&P::Meta