From 992c9c29fbaa0db007e075a43670ee5878c28953 Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Mon, 25 Mar 2024 19:01:58 +0800 Subject: [PATCH] fix typos --- saphyr/documents/2024-03-15-FirstRelease.md | 2 +- saphyr/src/emitter.rs | 2 +- saphyr/src/parser.rs | 2 +- saphyr/src/scanner.rs | 4 ++-- saphyr/tests/emitter.rs | 2 +- saphyr/tools/gen_large_yaml/src/main.rs | 2 +- saphyr/tools/gen_large_yaml/src/nested.rs | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/saphyr/documents/2024-03-15-FirstRelease.md b/saphyr/documents/2024-03-15-FirstRelease.md index 0dc1af1..7205fce 100644 --- a/saphyr/documents/2024-03-15-FirstRelease.md +++ b/saphyr/documents/2024-03-15-FirstRelease.md @@ -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: * 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 you use fully qualified paths. diff --git a/saphyr/src/emitter.rs b/saphyr/src/emitter.rs index 15f8cab..60eda8a 100644 --- a/saphyr/src/emitter.rs +++ b/saphyr/src/emitter.rs @@ -123,7 +123,7 @@ fn escape_str(wr: &mut dyn fmt::Write, v: &str) -> Result<(), fmt::Error> { } 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 { YamlEmitter { writer, diff --git a/saphyr/src/parser.rs b/saphyr/src/parser.rs index 288f232..43bf1aa 100644 --- a/saphyr/src/parser.rs +++ b/saphyr/src/parser.rs @@ -61,7 +61,7 @@ pub enum Event { Scalar(String, TScalarStyle, usize, Option), /// The start of a YAML sequence (array). SequenceStart( - /// The anchor ID of the start of the squence. + /// The anchor ID of the start of the sequence. usize, /// An optional tag Option, diff --git a/saphyr/src/scanner.rs b/saphyr/src/scanner.rs index 556ca9b..69f56ff 100644 --- a/saphyr/src/scanner.rs +++ b/saphyr/src/scanner.rs @@ -76,7 +76,7 @@ impl Marker { } } -/// An error that occured while scanning. +/// An error that occurred while scanning. #[derive(Clone, PartialEq, Debug, Eq)] pub struct ScanError { /// The position at which the error happened in the source. @@ -1912,7 +1912,7 @@ impl> Scanner { if (self.mark.col as isize) < self.indent { return Err(ScanError::new( start_mark, - "invalid identation in quoted scalar", + "invalid indentation in quoted scalar", )); } diff --git a/saphyr/tests/emitter.rs b/saphyr/tests/emitter.rs index 6460468..c085a56 100644 --- a/saphyr/tests/emitter.rs +++ b/saphyr/tests/emitter.rs @@ -37,7 +37,7 @@ a4: #[test] fn test_emit_complex() { let s = r" -cataloge: +catalogue: product: &coffee { name: Coffee, price: 2.5 , unit: 1l } product: &cookies { name: Cookies!, price: 3.40 , unit: 400g} diff --git a/saphyr/tools/gen_large_yaml/src/main.rs b/saphyr/tools/gen_large_yaml/src/main.rs index 86423bf..b585c59 100644 --- a/saphyr/tools/gen_large_yaml/src/main.rs +++ b/saphyr/tools/gen_large_yaml/src/main.rs @@ -42,7 +42,7 @@ struct Generator { /// The RNG state. /// /// 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, /// The stack of indentations. indents: Vec, diff --git a/saphyr/tools/gen_large_yaml/src/nested.rs b/saphyr/tools/gen_large_yaml/src/nested.rs index db93ff9..0f182a9 100644 --- a/saphyr/tools/gen_large_yaml/src/nested.rs +++ b/saphyr/tools/gen_large_yaml/src/nested.rs @@ -26,7 +26,7 @@ struct Tree { /// The RNG state. /// /// 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, }