Skip to content

Commit 83e7866

Browse files
authored
Merge pull request #62 from xibeiyoumian/main
chore: improve code comments clarity
2 parents 9411015 + 9c61290 commit 83e7866

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::collections::VecDeque;
99
use std::fmt::{self, Display};
1010
use std::rc::Rc;
1111

12-
/// a simple recursive type which is able to render its
12+
/// A simple recursive type which is able to render its
1313
/// components in a tree-like format
1414
#[derive(Debug, Clone)]
1515
pub struct Tree<D: Display> {
@@ -48,7 +48,7 @@ impl<D: Display> Tree<D> {
4848
}
4949

5050
impl<D: Display> Tree<D> {
51-
/// Ensure all lines for `root` are indented
51+
/// Set whether all lines for `root` should be indented
5252
pub fn set_multiline(&mut self, yes: bool) -> &mut Self {
5353
self.multiline = yes;
5454
self
@@ -90,7 +90,7 @@ impl<D: Display> Display for Tree<D> {
9090
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
9191
self.root.fmt(f)?; // Pass along `f.alternate()`
9292
writeln!(f)?;
93-
let mut queue = DisplauQueue::new();
93+
let mut queue = DisplayQueue::new();
9494
let no_space = Rc::new(Vec::new());
9595
let default_glyphs = GlyphPalette::new();
9696
let glyphs = self.glyphs.as_ref().unwrap_or(&default_glyphs);
@@ -163,10 +163,10 @@ impl<D: Display> Display for Tree<D> {
163163
}
164164
}
165165

166-
type DisplauQueue<'t, D> = VecDeque<(bool, &'t Tree<D>, &'t GlyphPalette, Rc<Vec<SpacePalette>>)>;
166+
type DisplayQueue<'t, D> = VecDeque<(bool, &'t Tree<D>, &'t GlyphPalette, Rc<Vec<SpacePalette>>)>;
167167

168168
fn enqueue_leaves<'t, D: Display>(
169-
queue: &mut DisplauQueue<'t, D>,
169+
queue: &mut DisplayQueue<'t, D>,
170170
parent: &'t Tree<D>,
171171
parent_glyphs: &'t GlyphPalette,
172172
spaces: Rc<Vec<SpacePalette>>,

0 commit comments

Comments
 (0)