/// Get FracBonds pointing from `site` to its neighbors, but fail if there are
/// not exactly three neighbors.
Get FracBonds pointing from `site` to its neighbors, but fail if there are
not exactly three neighbors.
Get FracBonds pointing from ` site ` to its neighbors but fail if there are not exactly three neighbors .
fn expect_three_bonds(intralayer_graph: &PeriodicGraph, site: usize) -> FailResult<[FracBond; 3]> {
                let mut edges = intralayer_graph.frac_bonds_from(site);
                match (edges.next(), edges.next(), edges.next(), edges.next()) {
                    (Some(b01), Some(b02), Some(b03), None) => Ok([b01, b02, b03]),
                    _ => bail!{
                        "\
                            The chosen 'kc.normals' setting requires all sites to have three neighbors; \
                            a site was found with {}.\
                        ", intralayer_graph.frac_bonds_from(site).count(),
                    },
                }
            }
fn expect_three_bonds ( intralayer_graph : & PeriodicGraph , site : usize ) -> FailResult < [ FracBond ; 3 ] > { let mut edges = intralayer_graph . frac_bonds_from ( site ) ; match ( edges . next ( ) , edges . next ( ) , edges . next ( ) , edges . next ( ) ) { ( Some ( b01 ) , Some ( b02 ) , Some ( b03 ) , None ) => Ok ( [ b01 , b02 , b03 ] ) , _ => bail ! { " \
 \
 \
 " intralayer_graph frac_bonds_from ( site ) count ( ) } , } }
Get FracBonds pointing from `site` to its neighbors, but fail if there are
not exactly three neighbors.
Get FracBonds pointing from ` site ` to its neighbors but fail if there are not exactly three neighbors .
intralayer_graph
&PeriodicGraph
site
usize