fn indent_count(&self, key: &str) -> Option<usize> {
        let mut spaces = key.chars().take_while(|c| *c == ' ').count();
        let mut indent = 0;
        if let Some(indent_spaces) = self.indent_spaces {
            assert!(indent_spaces > 0);
            while spaces >= indent_spaces {
                spaces -= indent_spaces;
                indent += 1;
            }
        }
        if spaces == 0 {
            Some(indent)
        } else {
            // Invalid indent
            None
        }
    }
/// Get indent count of a key
Get indent count of a key
Get indent count of a key
fn indent_count(&self, key: &str) -> Option<usize> {
        let mut spaces = key.chars().take_while(|c| *c == ' ').count();
        let mut indent = 0;
        if let Some(indent_spaces) = self.indent_spaces {
            assert!(indent_spaces > 0);
            while spaces >= indent_spaces {
                spaces -= indent_spaces;
                indent += 1;
            }
        }
        if spaces == 0 {
            Some(indent)
        } else {
            // Invalid indent
            None
        }
    }
fn indent_count ( & self , key : & str ) -> Option < usize > { let mut spaces = key . chars ( ) . take_while ( | c | * c == ' ' ) . count ( ) ; let mut indent = 0 ; if let Some ( indent_spaces ) = self . indent_spaces { assert ! ( indent_spaces 0 ) ; while spaces >= indent_spaces { spaces -= indent_spaces ; indent += 1 ; } } if spaces == 0 { Some ( indent ) } else { // Invalid indent None } }
Get indent count of a key
Get indent count of a key
&self
key
&str