fn toggle_comment_collapse_state(&mut self, i: usize, min_height: usize) {
        if i == self.len() || self.comments[i].height <= min_height {
            return;
        }
        match self.comments[i].state {
            client::CommentState::Collapsed => {
                self.comments[i].state = client::CommentState::Normal;
                self.get_comment_component_mut(i).unhide();
                self.toggle_comment_collapse_state(i + 1, min_height)
            }
            client::CommentState::Normal => {
                self.comments[i].state = client::CommentState::Collapsed;
                self.get_comment_component_mut(i).hide();
                self.toggle_comment_collapse_state(i + 1, min_height)
            }
            client::CommentState::PartiallyCollapsed => {
                let component = self.get_comment_component_mut(i);
                if component.is_visible() {
                    component.hide();
                } else {
                    component.unhide();
                }

                // skip toggling all child comments of the current comment
                let next_id = self.find_comment_id_by_max_height(i, self.comments[i].height, true);
                self.toggle_comment_collapse_state(next_id, min_height)
            }
        };
    }
/// Toggle the collapsing state of comments whose height is greater
/// than the `min_height`.
/// **Note** `PartiallyCollapsed` comment's state is unchanged, only toggle its visibility.
/// Also, the state and visibility of such comment's children are unaffected.
Toggle the collapsing state of comments whose height is greater
than the `min_height`.
Note** `PartiallyCollapsed` comment's state is unchanged, only toggle its visibility.
Also, the state and visibility of such comment's children are unaffected.
Toggle the collapsing state of comments whose height is greater than the ` min_height ` . Note ** ` PartiallyCollapsed ` comment ' s state is unchanged only toggle its visibility . Also the state and visibility of such comment ' s children are unaffected .
fn toggle_comment_collapse_state(&mut self, i: usize, min_height: usize) {
        if i == self.len() || self.comments[i].height <= min_height {
            return;
        }
        match self.comments[i].state {
            client::CommentState::Collapsed => {
                self.comments[i].state = client::CommentState::Normal;
                self.get_comment_component_mut(i).unhide();
                self.toggle_comment_collapse_state(i + 1, min_height)
            }
            client::CommentState::Normal => {
                self.comments[i].state = client::CommentState::Collapsed;
                self.get_comment_component_mut(i).hide();
                self.toggle_comment_collapse_state(i + 1, min_height)
            }
            client::CommentState::PartiallyCollapsed => {
                let component = self.get_comment_component_mut(i);
                if component.is_visible() {
                    component.hide();
                } else {
                    component.unhide();
                }
                // skip toggling all child comments of the current comment
                let next_id = self.find_comment_id_by_max_height(i, self.comments[i].height, true);
                self.toggle_comment_collapse_state(next_id, min_height)
            }
        };
    }
fn toggle_comment_collapse_state ( & mut self , i : usize , min_height : usize ) { if i == self . len ( ) || self . comments [ i ] . height <= min_height { return ; } match self . comments [ i ] . state { client :: CommentState :: Collapsed => { self . comments [ i ] . state = client :: CommentState :: Normal ; self . get_comment_component_mut ( i ) . unhide ( ) ; self . toggle_comment_collapse_state ( i + 1 , min_height ) } client :: CommentState :: Normal => { self . comments [ i ] . state = client :: CommentState :: Collapsed ; self . get_comment_component_mut ( i ) . hide ( ) ; self . toggle_comment_collapse_state ( i + 1 , min_height ) } client :: CommentState :: PartiallyCollapsed => { let component = self . get_comment_component_mut ( i ) ; if component . is_visible ( ) { component . hide ( ) ; } else { component . unhide ( ) ; } // skip toggling all child comments of the current comment let next_id = self . find_comment_id_by_max_height ( i , self . comments [ i ] . height , true ) ; self . toggle_comment_collapse_state ( next_id , min_height ) } } ; }
Toggle the collapsing state of comments whose height is greater
than the `min_height`.
Toggle the collapsing state of comments whose height is greater than the ` min_height ` .
&mut self
i
usize
min_height
usize