From ad460446c953a3ef009e12fc21b025000f144768 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Fri, 1 May 2020 21:40:10 +0200 Subject: [PATCH 1/2] doc: make Stack and StackElement a little pretty Also, fix rustdoc warnings. --- src/libserialize/json.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/libserialize/json.rs b/src/libserialize/json.rs index 7565bdeb4096e..496011b694715 100644 --- a/src/libserialize/json.rs +++ b/src/libserialize/json.rs @@ -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, str_buffer: Vec, } /// 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 compositing the stack that represents `foo.bar[3].x`. #[derive(PartialEq, Clone, Debug)] pub enum StackElement<'l> { Index(u32), From 3406b53bac5141a54b30ac90e83123e0de9a7e5d Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sat, 2 May 2020 08:51:54 +0200 Subject: [PATCH 2/2] Update src/libserialize/json.rs Co-authored-by: Jonas Schievink --- src/libserialize/json.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libserialize/json.rs b/src/libserialize/json.rs index 496011b694715..8f46649048aa9 100644 --- a/src/libserialize/json.rs +++ b/src/libserialize/json.rs @@ -1428,7 +1428,7 @@ pub struct Stack { /// /// As an 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`. +/// StackElements composing the stack that represents `foo.bar[3].x`. #[derive(PartialEq, Clone, Debug)] pub enum StackElement<'l> { Index(u32),