fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        // items
        let mut unique_items: HashMap<usize, bool> = HashMap::new();
        let mut indices: Vec<_> = self.containers.keys().collect();
        indices.sort();
        for index in indices {
            let container = self.containers.get(index).unwrap();
            let mut ids: Vec<_> = container.values().map(|item| item.id).collect();
            ids.sort();
            write!(f, "{}: {:?}\n", index, ids).unwrap();
            for id in ids {
                unique_items.insert(id, true);
            }
        }
        // summary
        let mut ids: Vec<_> = unique_items.keys().collect();
        ids.sort();
        write!(f, "ids = {:?}\n", ids).unwrap();
        write!(f, "nitem = {}\n", unique_items.len()).unwrap();
        write!(f, "ncontainer = {}\n", self.containers.len()).unwrap();
        write!(f, "ndiv = {:?}\n", self.ndiv).unwrap();
        Ok(())
    }
/// Shows info about the items in the grid containers
Shows info about the items in the grid containers
Shows info about the items in the grid containers
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        // items
        let mut unique_items: HashMap<usize, bool> = HashMap::new();
        let mut indices: Vec<_> = self.containers.keys().collect();
        indices.sort();
        for index in indices {
            let container = self.containers.get(index).unwrap();
            let mut ids: Vec<_> = container.values().map(|item| item.id).collect();
            ids.sort();
            write!(f, "{}: {:?}\n", index, ids).unwrap();
            for id in ids {
                unique_items.insert(id, true);
            }
        }
        // summary
        let mut ids: Vec<_> = unique_items.keys().collect();
        ids.sort();
        write!(f, "ids = {:?}\n", ids).unwrap();
        write!(f, "nitem = {}\n", unique_items.len()).unwrap();
        write!(f, "ncontainer = {}\n", self.containers.len()).unwrap();
        write!(f, "ndiv = {:?}\n", self.ndiv).unwrap();
        Ok(())
    }
fn fmt ( & self , f : & mut fmt :: Formatter < ' _ > ) -> fmt :: Result { // items let mut unique_items : HashMap < usize , bool > = HashMap :: new ( ) ; let mut indices : Vec < _ > = self . containers . keys ( ) . collect ( ) ; indices . sort ( ) ; for index in indices { let container = self . containers . get ( index ) . unwrap ( ) ; let mut ids : Vec < _ > = container . values ( ) . map ( | item | item . id ) . collect ( ) ; ids . sort ( ) ; write ! ( f " \n " index ids ) . unwrap ( ) ; for id in ids { unique_items . insert ( id , true ) ; } } // summary let mut ids : Vec < _ > = unique_items . keys ( ) . collect ( ) ; ids . sort ( ) ; write ! ( f " \n " ids ) . unwrap ( ) ; write ! ( f " \n " unique_items len ( ) ) . unwrap ( ) ; write ! ( f " \n " self containers len ( ) ) . unwrap ( ) ; write ! ( f " \n " self ndiv ) . unwrap ( ) ; Ok ( ( ) ) }
Shows info about the items in the grid containers
Shows info about the items in the grid containers
&self
f
&mut fmt::Formatter<'_>
&self
f
&mut fmt::Formatter<'_>