Skip to content

Commit

Permalink
Rollup merge of rust-lang#71767 - tshepang:stack-stuff, r=jonas-schie…
Browse files Browse the repository at this point in the history
…vink

doc: make Stack and StackElement a little pretty

Also, fix rustdoc warnings.
  • Loading branch information
Dylan-DPC committed May 2, 2020
2 parents b121d7c + 3406b53 commit a299abd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/libserialize/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1417,16 +1417,18 @@ enum ParserState {

/// A Stack represents the current position of the parser in the logical
/// structure of the JSON stream.
/// For example foo.bar[3].x
///
/// An example is `foo.bar[3].x`.
pub struct Stack {
stack: Vec<InternalStackElement>,
str_buffer: Vec<u8>,
}

/// StackElements compose a Stack.
/// For example, StackElement::Key("foo"), StackElement::Key("bar"),
/// StackElement::Index(3) and StackElement::Key("x") are the
/// StackElements compositing the stack that represents foo.bar[3].x
///
/// As an example, `StackElement::Key("foo")`, `StackElement::Key("bar")`,
/// `StackElement::Index(3)`, and `StackElement::Key("x")` are the
/// StackElements composing the stack that represents `foo.bar[3].x`.
#[derive(PartialEq, Clone, Debug)]
pub enum StackElement<'l> {
Index(u32),
Expand Down

0 comments on commit a299abd

Please sign in to comment.