fix typos

This commit is contained in:
John Vandenberg 2024-03-25 19:01:58 +08:00 committed by Ethiraric
parent 37f52b7722
commit 992c9c29fb
7 changed files with 8 additions and 8 deletions

View file

@ -102,7 +102,7 @@ Switching to `yaml-rust2` should be a very simple process. Change your `Cargo.to
As for your code, you have one of two solutions: As for your code, you have one of two solutions:
* Changing your imports from `use yaml_rust::Yaml` to `use yaml_rust2::Yaml` if you import items directly, or change * Changing your imports from `use yaml_rust::Yaml` to `use yaml_rust2::Yaml` if you import items directly, or change
occurences of `yaml_rust` to `yaml_rust2` if you use fully qualified paths. occurrences of `yaml_rust` to `yaml_rust2` if you use fully qualified paths.
* Alternatively, you can alias `yaml_rust2` with `use yaml_rust2 as yaml_rust`. This would keep your code working if * Alternatively, you can alias `yaml_rust2` with `use yaml_rust2 as yaml_rust`. This would keep your code working if
you use fully qualified paths. you use fully qualified paths.

View file

@ -123,7 +123,7 @@ fn escape_str(wr: &mut dyn fmt::Write, v: &str) -> Result<(), fmt::Error> {
} }
impl<'a> YamlEmitter<'a> { impl<'a> YamlEmitter<'a> {
/// Create a nwe emitter serializing into `writer`. /// Create a new emitter serializing into `writer`.
pub fn new(writer: &'a mut dyn fmt::Write) -> YamlEmitter { pub fn new(writer: &'a mut dyn fmt::Write) -> YamlEmitter {
YamlEmitter { YamlEmitter {
writer, writer,

View file

@ -61,7 +61,7 @@ pub enum Event {
Scalar(String, TScalarStyle, usize, Option<Tag>), Scalar(String, TScalarStyle, usize, Option<Tag>),
/// The start of a YAML sequence (array). /// The start of a YAML sequence (array).
SequenceStart( SequenceStart(
/// The anchor ID of the start of the squence. /// The anchor ID of the start of the sequence.
usize, usize,
/// An optional tag /// An optional tag
Option<Tag>, Option<Tag>,

View file

@ -76,7 +76,7 @@ impl Marker {
} }
} }
/// An error that occured while scanning. /// An error that occurred while scanning.
#[derive(Clone, PartialEq, Debug, Eq)] #[derive(Clone, PartialEq, Debug, Eq)]
pub struct ScanError { pub struct ScanError {
/// The position at which the error happened in the source. /// The position at which the error happened in the source.
@ -1912,7 +1912,7 @@ impl<T: Iterator<Item = char>> Scanner<T> {
if (self.mark.col as isize) < self.indent { if (self.mark.col as isize) < self.indent {
return Err(ScanError::new( return Err(ScanError::new(
start_mark, start_mark,
"invalid identation in quoted scalar", "invalid indentation in quoted scalar",
)); ));
} }

View file

@ -37,7 +37,7 @@ a4:
#[test] #[test]
fn test_emit_complex() { fn test_emit_complex() {
let s = r" let s = r"
cataloge: catalogue:
product: &coffee { name: Coffee, price: 2.5 , unit: 1l } product: &coffee { name: Coffee, price: 2.5 , unit: 1l }
product: &cookies { name: Cookies!, price: 3.40 , unit: 400g} product: &cookies { name: Cookies!, price: 3.40 , unit: 400g}

View file

@ -42,7 +42,7 @@ struct Generator {
/// The RNG state. /// The RNG state.
/// ///
/// We don't need to be cryptographically secure. [`SmallRng`] also implements the /// We don't need to be cryptographically secure. [`SmallRng`] also implements the
/// [`SeedableRng`] trait, allowing runs to be predictible. /// [`SeedableRng`] trait, allowing runs to be predictable.
rng: SmallRng, rng: SmallRng,
/// The stack of indentations. /// The stack of indentations.
indents: Vec<usize>, indents: Vec<usize>,

View file

@ -26,7 +26,7 @@ struct Tree {
/// The RNG state. /// The RNG state.
/// ///
/// We don't need to be cryptographically secure. [`SmallRng`] also implements the /// We don't need to be cryptographically secure. [`SmallRng`] also implements the
/// [`SeedableRng`] trait, allowing runs to be predictible. /// [`SeedableRng`] trait, allowing runs to be predictable.
rng: SmallRng, rng: SmallRng,
} }