fn make_define(
        &self,
        key: &'a str,
        separator: Separator,
        value: &'a str,
    ) -> Result<Define<'a>, ParseError> {
        // is key blank? (all spaces)
        if key.chars().all(|c| c == ' ') {
            if key.len() == self.key_len() {
                if let Some(define) = self.define {
                    return Ok(Define::new(
                        define.indent,
                        define.key,
                        separator,
                        value,
                    ));
                }
            }
        } else if let Some(indent) = self.indent_count(key) {
            let mut k = key;
            // trim leading spaces only (not all whitespace)
            while let Some(' ') = k.chars().next() {
                k = &k[1..];
            }
            return Ok(Define::new(indent, k, separator, value));
        }
        Err(ParseError::InvalidIndent)
    }
/// Make a definition from key and value
Make a definition from key and value
Make a definition from key and value
fn make_define(
        &self,
        key: &'a str,
        separator: Separator,
        value: &'a str,
    ) -> Result<Define<'a>, ParseError> {
        // is key blank? (all spaces)
        if key.chars().all(|c| c == ' ') {
            if key.len() == self.key_len() {
                if let Some(define) = self.define {
                    return Ok(Define::new(
                        define.indent,
                        define.key,
                        separator,
                        value,
                    ));
                }
            }
        } else if let Some(indent) = self.indent_count(key) {
            let mut k = key;
            // trim leading spaces only (not all whitespace)
            while let Some(' ') = k.chars().next() {
                k = &k[1..];
            }
            return Ok(Define::new(indent, k, separator, value));
        }
        Err(ParseError::InvalidIndent)
    }
fn make_define ( & self , key : & ' a str , separator : Separator , value : & ' a str , ) -> Result < Define < ' a > , ParseError > { // is key blank? (all spaces) if key . chars ( ) . all ( | c | c == ' ' ) { if key . len ( ) == self . key_len ( ) { if let Some ( define ) = self . define { return Ok ( Define :: new ( define . indent , define . key , separator , value , ) ) ; } } } else if let Some ( indent ) = self . indent_count ( key ) { let mut k = key ; // trim leading spaces only (not all whitespace) while let Some ( ' ' ) = k . chars ( ) . next ( ) { k = & k [ 1 .. ] ; } return Ok ( Define :: new ( indent , k , separator , value ) ) ; } Err ( ParseError :: InvalidIndent ) }
Make a definition from key and value
Make a definition from key and value
&self
key
&'a str
separator
Separator
value
&'a str