Added line to BadIndent error.

[?]
Mar 7, 2021, 12:49 PM
VDFODD2FXIZGSSAH63WL56JGHDZQLVOZXOAAWQ3KKHXH66UCKMAAC

Dependencies

Change contents

  • edit in src/path.rs at line 1
    [2.17]
    [2.18]
    //! A path such as `hobbit::friend`, used to select a key in
    //! the tree.
  • edit in src/path.rs at line 9
    [2.133][2.133:616]()
    ///
    /// For example the keypath `"hobbit::friends"` will select the tree of two
    /// hobbits Frodo and Samwise from the following keytree. `"hobbit:age"` will
    /// select Frodo's age.
    ///
    /// ```
    /// hobbit:
    /// name: Frodo Baggins
    /// age: 60
    /// friends:
    /// hobbit:
    /// name: Bilbo Baggins
    /// age: 111
    /// hobbit:
    /// name: Samwise Gamgee
    /// age: 38
    /// nick: Sam
    /// ```
  • replacement in src/path.rs at line 10
    [2.654][2.654:691]()
    pub struct KeyPath(pub Vec<String>);
    [2.654]
    [2.691]
    pub(crate) struct KeyPath(pub Vec<String>);
  • replacement in src/path.rs at line 30
    [2.1081][2.1081:1128]()
    pub (crate) fn from_str(s: &str) -> Self {
    [2.1081]
    [2.1128]
    pub(crate) fn from_str(s: &str) -> Self {
  • replacement in src/parser.rs at line 266
    [2.10727][2.10727:10869]()
    let indent = indent(&mut root_indent, line_start, start_key)
    .map_err(|e| e.from_inner(&token))?;
    [2.10727]
    [2.10869]
    let indent = indent(
    &mut root_indent,
    line_start,
    start_key
    ).map_err(|e| e.from_inner(&token, line))?;
  • replacement in src/parser.rs at line 282
    [2.11331][2.11331:11473]()
    let indent = indent(&mut root_indent, line_start, start_key)
    .map_err(|e| e.from_inner(&token))?;
    [2.11331]
    [2.11473]
    let indent = indent(
    &mut root_indent,
    line_start,
    start_key
    ).map_err(|e| e.from_inner(&token, line))?;
  • replacement in src/parser.rs at line 298
    [2.11941][2.11941:12083]()
    let indent = indent(&mut root_indent, line_start, start_key)
    .map_err(|e| e.from_inner(&token))?;
    [2.11941]
    [2.12083]
    let indent = indent(
    &mut root_indent,
    line_start,
    start_key
    ).map_err(|e| e.from_inner(&token, line))?;
  • replacement in src/parser.rs at line 347
    [2.13553][2.13553:13648]()
    return Err(Error::new(ErrorKind::NoColonAfterKey(token_str.to_string())));
    [2.13553]
    [2.13648]
    return Err(Error::new(
    ErrorKind::NoColonAfterKey(
    token_str.to_string()
    )
    ));
  • replacement in src/parser.rs at line 355
    [2.13777][2.13777:13879]()
    return Err(Error::new(ErrorKind::IncompleteCommentOrKey(token_str.to_string())));
    [2.13777]
    [2.13879]
    return Err(Error::new(
    ErrorKind::IncompleteCommentOrKey(
    token_str.to_string()
    )
    ));
  • replacement in src/parser.rs at line 365
    [2.13974][2.13974:14046]()
    return Err(Error::new(ErrorKind::NoSpaceAfterKey));
    [2.13974]
    [2.14046]
    return Err(Error::new(
    ErrorKind::NoSpaceAfterKey)
    );
  • replacement in src/parser.rs at line 374
    [2.14181][2.14181:14270]()
    return Err(Error::new(ErrorKind::IncompleteLine(String::from("/"))))
    [2.14181]
    [2.14270]
    return Err(Error::new(
    ErrorKind::IncompleteLine(
    String::from("/")
    )
    ))
  • replacement in src/parser.rs at line 383
    [2.14429][2.14429:14523]()
    return Err(Error::new(ErrorKind::IncompleteLine(token_str.to_string())));
    [2.14429]
    [2.14523]
    return Err(Error::new(
    ErrorKind::IncompleteLine(
    token_str.to_string()
    )
    ));
  • replacement in src/parser.rs at line 394
    [2.14661][2.14661:14732]()
    return Err(Error::new(ErrorKind::ColonBeforeKey));
    [2.14661]
    [2.14732]
    return Err(Error::new(
    ErrorKind::ColonBeforeKey)
    );
  • replacement in src/parser.rs at line 400
    [2.14834][2.14834:14905]()
    return Err(Error::new(ErrorKind::ColonBeforeKey));
    [2.14834]
    [2.14905]
    return Err(Error::new(
    ErrorKind::ColonBeforeKey)
    );
  • replacement in src/parser.rs at line 405
    [2.14968][2.14968:15040]()
    return Err(Error::new(ErrorKind::NoSpaceAfterKey));
    [2.14968]
    [2.15040]
    return Err(Error::new(
    ErrorKind::NoSpaceAfterKey
    ));
  • replacement in src/parser.rs at line 414
    [2.15213][2.15213:15315]()
    return Err(Error::new(ErrorKind::IncompleteCommentOrKey(token_str.to_string())));
    [2.15213]
    [2.15315]
    return Err(Error::new(
    ErrorKind::IncompleteCommentOrKey(
    token_str.to_string()
    )
    ));
  • replacement in src/parser.rs at line 421
    [2.15385][2.15385:15457]()
    return Err(Error::new(ErrorKind::NoSpaceAfterKey));
    [2.15385]
    [2.15457]
    return Err(Error::new(
    ErrorKind::NoSpaceAfterKey)
    );
  • replacement in src/parser.rs at line 436
    [2.15735][2.15735:15833]()
    return Err(Error::new(ErrorKind::IncompleteCommentOrKey(token_str.to_string())));
    [2.15735]
    [2.15833]
    return Err(Error::new(
    ErrorKind::IncompleteCommentOrKey(
    token_str.to_string(),
    )
    ));
  • replacement in src/parser.rs at line 445
    [2.15952][2.15952:16042]()
    return Err(Error::new(ErrorKind::IncompleteLine(token_str.to_string())));
    [2.15952]
    [2.16042]
    return Err(Error::new(
    ErrorKind::IncompleteLine(
    token_str.to_string()
    )
    ));
  • replacement in src/parser.rs at line 454
    [2.16150][2.16150:16351]()
    key: &s[start_key..s.chars().count() - 1],
    children: Vec::new(),
    next: None,
    line: Line::new(line),
    [2.16150]
    [2.16351]
    key: &s[start_key..s.chars().count() - 1],
    children: Vec::new(),
    next: None,
    line: Line::new(line),
  • replacement in src/parser.rs at line 459
    [2.16370][2.16370:16504]()
    let indent = indent(&mut root_indent, line_start, start_key)
    .map_err(|e| e.from_inner(&token))?;
    [2.16370]
    [2.16504]
    let indent = indent(
    &mut root_indent,
    line_start,
    start_key
    ).map_err(|e| e.from_inner(&token, line))?;
  • replacement in src/parser.rs at line 474
    [2.16863][2.16863:16997]()
    let indent = indent(&mut root_indent, line_start, start_key)
    .map_err(|e| e.from_inner(&token))?;
    [2.16863]
    [2.16997]
    let indent = indent(
    &mut root_indent,
    line_start,
    start_key
    ).map_err(|e| e.from_inner(&token, line))?;
  • replacement in src/parser.rs at line 484
    [2.17162][2.17162:17339]()
    key: &s[start_key..=end_key],
    value: &s[start_val..],
    next: None,
    line: Line::new(line),
    [2.17162]
    [2.17339]
    key: &s[start_key..=end_key],
    value: &s[start_val..],
    next: None,
    line: Line::new(line),
  • replacement in src/parser.rs at line 489
    [2.17358][2.17358:17492]()
    let indent = indent(&mut root_indent, line_start, start_key)
    .map_err(|e| e.from_inner(&token))?;
    [2.17358]
    [2.17492]
    let indent = indent(
    &mut root_indent,
    line_start,
    start_key
    ).map_err(|e| e.from_inner(&token, line))?;
  • replacement in src/parser.rs at line 521
    [2.18130][2.18130:18200]()
    let chars_indent = start_key - line_start - *root_indent;
    [2.18130]
    [2.18200]
    let chars_indent = start_key -
    line_start -
    *root_indent;
  • replacement in src/parser.rs at line 526
    [2.18249][2.18249:18330]()
    return Err(Error::new(ErrorKind::InnerBadIndent(chars_indent)));
    [2.18249]
    [2.18330]
    return Err(Error::new(
    ErrorKind::InnerBadIndent(
    chars_indent
    )
    ));
  • replacement in src/lib.rs at line 11
    [2.18623][2.18623:18953]()
    pub mod parser;
    pub mod path;
    // impl<'a> Display for Token<'a> {
    // fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    // match self {
    // Token::Key { line, .. } => write!(f, "{}", line),
    // Token::KeyValue { line, .. } => write!(f, "{}", line),
    // }
    // }
    // }
    [2.18623]
    [2.18953]
    pub(crate) mod parser;
    pub(crate) mod path;
  • edit in src/lib.rs at line 16
    [2.19003]
    [2.19003]
    /// Indicates line number for error messages.
  • replacement in src/lib.rs at line 35
    [2.19342][2.19342:19363]()
    pub enum Token<'a> {
    [2.19342]
    [2.19363]
    pub(crate) enum Token<'a> {
  • edit in src/lib.rs at line 93
    [2.20896][2.20896:21081]()
    // fn new(s: &'a str) -> Self {
    // Token::Key {
    // key: s,
    // children: Vec::new(),
    // next: None,
    // }
    // }
  • edit in src/lib.rs at line 153
    [2.22562][2.22562:22754]()
    // impl<'a, T> TryInto<T> for KeyTree<'a> {
    // type Error = Error;
    //
    // fn try_into(self) -> std::result::Result<T, Self::Error> {
    // self.to_ref().try_into()
    // }
    // }
  • replacement in src/lib.rs at line 177
    [2.23311][2.23311:23422]()
    /// Coerces the value at key_path from a string to the receiver type.
    /// See top page for an example.
    [2.23311]
    [2.23422]
    /// Coerces the value at key_path from a string to the
    /// receiver type. See top page for an example.
  • replacement in src/lib.rs at line 181
    [2.23486][2.23486:23579]()
    KeyTreeRef<'a>: TryInto<T>,
    KeyTreeRef<'a>: TryInto<T, Error = Error>,
    [2.23486]
    [2.23579]
    KeyTreeRef<'a>: TryInto<T>,
    KeyTreeRef<'a>: TryInto<T, Error = Error>,
  • replacement in src/lib.rs at line 196
    [2.23901][2.23901:24060]()
    /// Coerces the value at key_path from a string to `Some` of the receiver
    /// type, or None if there is nothing at key_path. See top page for example.
    [2.23901]
    [2.24060]
    /// Coerces the value at key_path from a string to
    /// Some` of the receiver type, or None if there is
    /// nothing at key_path. See top page for example.
  • replacement in src/lib.rs at line 201
    [2.24132][2.24132:24225]()
    KeyTreeRef<'a>: TryInto<T>,
    KeyTreeRef<'a>: TryInto<T, Error = Error>,
    [2.24132]
    [2.24225]
    KeyTreeRef<'a>: TryInto<T>,
    KeyTreeRef<'a>: TryInto<T, Error = Error>,
  • replacement in src/lib.rs at line 210
    [2.24405][2.24405:24447]()
    // Check that top token is unique
    [2.24405]
    [2.24447]
    // Check that top token is unique.
  • replacement in src/lib.rs at line 228
    [2.25026][2.25026:25119]()
    KeyTreeRef<'a>: TryInto<T>,
    KeyTreeRef<'a>: TryInto<T, Error = Error>,
    [2.25026]
    [2.25119]
    KeyTreeRef<'a>: TryInto<T>,
    KeyTreeRef<'a>: TryInto<T, Error = Error>,
  • replacement in src/lib.rs at line 247
    [2.25576][2.25576:25654]()
    pub (crate) fn recurse(&self, path: &KeyPath) -> Result<KeyTreeRef<'a>> {
    [2.25576]
    [2.25654]
    pub (crate) fn recurse(
    &self,
    path: &KeyPath) -> Result<KeyTreeRef<'a>>
    {
  • replacement in src/lib.rs at line 273
    [2.26508][2.26508:26577]()
    return Err(Error::new(ErrorKind::EKeyFKeyValue))
    [2.26508]
    [2.26577]
    return Err(Error::new(
    ErrorKind::EKeyFKeyValue
    ))
  • replacement in src/lib.rs at line 281
    [2.26783][2.26783:27076]()
    return Err(Error::new(ErrorKind::NoChildWithSegment(
    self.top_token().to_string(),
    self.top_token().line().to_string(),
    key.to_string(),
    )))
    [2.26783]
    [2.27076]
    return Err(Error::new(
    ErrorKind::NoChildWithSegment(
    self.top_token().to_string(),
    self.top_token().line().to_string(),
    key.to_string(),
    )
    ))
  • replacement in src/lib.rs at line 296
    [2.27190][2.27190:27279]()
    pub (crate) fn op_recurse(&self, path: &KeyPath) -> Result<Option<KeyTreeRef<'a>>> {
    [2.27190]
    [2.27279]
    pub (crate) fn op_recurse(
    &self,
    path: &KeyPath) -> Result<Option<KeyTreeRef<'a>>>
    {
  • replacement in src/lib.rs at line 304
    [2.27411][2.27411:27510]()
    ErrorKind::NoChildWithSegment(_, _, _) | ErrorKind::EKeyFKeyValue => Ok(None),
    [2.27411]
    [2.27510]
    ErrorKind::NoChildWithSegment(_, _, _)
    | ErrorKind::EKeyFKeyValue => {
    Ok(None)
    },
  • edit in src/into.rs at line 1
    [2.29329]
    [2.29330]
    //! Conversions from the value of a key/value pair.
    //!
    //! Conversions can be implemented by the client.
    //! `from_str` is a helper function that takes a description
    //! of the type being converted into, for use in error
    //! messages.
    //!
    //! ```
    //! impl<'a> TryInto<f32> for KeyTreeRef<'a> {
    //! type Error = Error;
    //!
    //! fn try_into(self) -> Result<f32> {
    //! self.from_str("f32")
    //! }
    //! }
    //! ```
  • replacement in src/error.rs at line 24
    [2.37158][2.37158:37219]()
    pub fn from_inner<T: Display>(self, token: T) -> Error {
    [2.37158]
    [2.37219]
    pub fn from_inner<T: Display>(
    self,
    token: T,
    line: usize) -> Error
    {
  • replacement in src/error.rs at line 31
    [2.37298][2.37298:37374]()
    Error::new(ErrorKind::BadIndent(token.to_string(), indent))
    [2.37298]
    [2.37374]
    Error::new(ErrorKind::BadIndent(token.to_string(), line, indent))
  • replacement in src/error.rs at line 61
    [2.37954][2.37954:38055]()
    // BadIndent(token as string, chars indented relative to root key)
    BadIndent(String, usize),
    [2.37954]
    [2.38055]
    // BadIndent(token as string, line, chars indented relative to root key)
    BadIndent(String, usize, usize),
  • replacement in src/error.rs at line 115
    [2.39612][2.39612:39673]()
    ErrorKind::BadIndent(_, _) => None,
    [2.39612]
    [2.39673]
    ErrorKind::BadIndent(_, _, _) => None,
  • replacement in src/error.rs at line 181
    [2.41931][2.41931:41984]()
    ErrorKind::BadIndent(token, indent) => {
    [2.41931]
    [2.41984]
    ErrorKind::BadIndent(token, line, indent) => {
  • replacement in src/error.rs at line 183
    [2.42010][2.42010:42104]()
    "Indent of \"{}\" relative to root key is {} but must be multiple of 4.",
    [2.42010]
    [2.42104]
    "Indent of \"{}: {}\" on relative to root key is {} but must be multiple of 4.",
    line,
  • edit in src/builder.rs at line 13
    [2.48042][2.48042:48065]()
    dbg!(&self.0);
  • replacement in examples/hobbit/src/main.rs at line 19
    [2.49245][2.49245:49284]()
    name: String,
    age: u32,
    [2.49245]
    [2.49284]
    name: String,
    age: u32,
  • replacement in examples/hobbit/src/main.rs at line 22
    [2.49310][2.49310:49339]()
    nick: Option<String>,
    [2.49310]
    [2.49339]
    nick: Option<String>,
  • replacement in examples/hobbit/src/main.rs at line 31
    [2.49495][2.49495:49722]()
    name: self.at("hobbit::name")?,
    age: self.at("hobbit::age")?,
    friends: self.vec("hobbit::friends::hobbit")?,
    nick: self.op("hobbit::nick")?,
    [2.49495]
    [2.49722]
    name: self.at("hobbit::name")?,
    age: self.at("hobbit::age")?,
    friends: self.vec("hobbit::friends::hobbit")?,
    nick: self.op("hobbit::nick")?,