Skip to content

Commit b019d76

Browse files
authored
Spellcheck (#143)
* Spellcheck src * Spellcheck README
1 parent 7d057ad commit b019d76

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ so it may not be a huge problem for most users.
101101

102102
* Encoder
103103
* Tag directive
104-
* Alias while desearilization
104+
* Alias while deserialization
105105

106106
## Minimum Rust version policy
107107

src/emitter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ impl<'a> YamlEmitter<'a> {
238238

239239
/// Emit a yaml as a hash or array value: i.e., which should appear
240240
/// following a ":" or "-", either after a space, or on a new line.
241-
/// If `inline` is true, then the preceeding characters are distinct
241+
/// If `inline` is true, then the preceding characters are distinct
242242
/// and short enough to respect the compact flag.
243243
fn emit_val(&mut self, inline: bool, val: &Yaml) -> EmitResult {
244244
match *val {
@@ -320,7 +320,7 @@ fn need_quotes(string: &str) -> bool {
320320
|| [
321321
// http://yaml.org/type/bool.html
322322
// Note: 'y', 'Y', 'n', 'N', is not quoted deliberately, as in libyaml. PyYAML also parse
323-
// them as string, not booleans, although it is volating the YAML 1.1 specification.
323+
// them as string, not booleans, although it is violating the YAML 1.1 specification.
324324
// See https://github.com/dtolnay/serde-yaml/pull/83#discussion_r152628088.
325325
"yes", "Yes", "YES", "no", "No", "NO", "True", "TRUE", "true", "False", "FALSE",
326326
"false", "on", "On", "ON", "off", "Off", "OFF",

src/parser.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ impl<T: Iterator<Item = char>> Parser<T> {
349349
| Token(_, TokenType::TagDirective(..))
350350
| Token(_, TokenType::DocumentStart) => {
351351
// explicit document
352-
self._explict_document_start()
352+
self._explicit_document_start()
353353
}
354354
Token(mark, _) if implicit => {
355355
self.parser_process_directives()?;
@@ -359,7 +359,7 @@ impl<T: Iterator<Item = char>> Parser<T> {
359359
}
360360
_ => {
361361
// explicit document
362-
self._explict_document_start()
362+
self._explicit_document_start()
363363
}
364364
}
365365
}
@@ -385,7 +385,7 @@ impl<T: Iterator<Item = char>> Parser<T> {
385385
Ok(())
386386
}
387387

388-
fn _explict_document_start(&mut self) -> ParseResult {
388+
fn _explicit_document_start(&mut self) -> ParseResult {
389389
self.parser_process_directives()?;
390390
match *self.peek_token()? {
391391
Token(mark, TokenType::DocumentStart) => {
@@ -433,7 +433,7 @@ impl<T: Iterator<Item = char>> Parser<T> {
433433
}
434434

435435
fn register_anchor(&mut self, name: String, _: &Marker) -> Result<usize, ScanError> {
436-
// anchors can be overrided/reused
436+
// anchors can be overridden/reused
437437
// if self.anchors.contains_key(name) {
438438
// return Err(ScanError::new(*mark,
439439
// "while parsing anchor, found duplicated anchor"));
@@ -704,7 +704,7 @@ impl<T: Iterator<Item = char>> Parser<T> {
704704
Token(mark, _) if !first => {
705705
return Err(ScanError::new(
706706
mark,
707-
"while parsing a flow sequence, expectd ',' or ']'",
707+
"while parsing a flow sequence, expected ',' or ']'",
708708
));
709709
}
710710
_ => { /* next */ }

src/scanner.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,7 @@ impl<T: Iterator<Item = char>> Scanner<T> {
11001100
if self.ch() == '0' {
11011101
return Err(ScanError::new(
11021102
start_mark,
1103-
"while scanning a block scalar, found an intendation indicator equal to 0",
1103+
"while scanning a block scalar, found an indentation indicator equal to 0",
11041104
));
11051105
}
11061106
increment = (self.ch() as usize) - ('0' as usize);
@@ -1110,7 +1110,7 @@ impl<T: Iterator<Item = char>> Scanner<T> {
11101110
if self.ch() == '0' {
11111111
return Err(ScanError::new(
11121112
start_mark,
1113-
"while scanning a block scalar, found an intendation indicator equal to 0",
1113+
"while scanning a block scalar, found an indentation indicator equal to 0",
11141114
));
11151115
}
11161116

@@ -1200,7 +1200,7 @@ impl<T: Iterator<Item = char>> Scanner<T> {
12001200
self.lookahead(2);
12011201
self.read_break(&mut leading_break);
12021202

1203-
// Eat the following intendation spaces and line breaks.
1203+
// Eat the following indentation spaces and line breaks.
12041204
self.block_scalar_breaks(&mut indent, &mut trailing_breaks)?;
12051205
}
12061206

@@ -1239,10 +1239,10 @@ impl<T: Iterator<Item = char>> Scanner<T> {
12391239
max_indent = self.mark.col;
12401240
}
12411241

1242-
// Check for a tab character messing the intendation.
1242+
// Check for a tab character messing the indentation.
12431243
if (*indent == 0 || self.mark.col < *indent) && self.buffer[0] == '\t' {
12441244
return Err(ScanError::new(self.mark,
1245-
"while scanning a block scalar, found a tab character where an intendation space is expected"));
1245+
"while scanning a block scalar, found a tab character where an indentation space is expected"));
12461246
}
12471247

12481248
if !is_break(self.ch()) {
@@ -1384,7 +1384,7 @@ impl<T: Iterator<Item = char>> Scanner<T> {
13841384
for i in 0..code_length {
13851385
if !is_hex(self.buffer[i]) {
13861386
return Err(ScanError::new(start_mark,
1387-
"while parsing a quoted scalar, did not find expected hexdecimal number"));
1387+
"while parsing a quoted scalar, did not find expected hexadecimal number"));
13881388
}
13891389
value = (value << 4) + as_hex(self.buffer[i]);
13901390
}
@@ -1589,7 +1589,7 @@ impl<T: Iterator<Item = char>> Scanner<T> {
15891589
self.lookahead(1);
15901590
}
15911591

1592-
// check intendation level
1592+
// check indentation level
15931593
if self.flow_level == 0 && (self.mark.col as isize) < indent {
15941594
break;
15951595
}
@@ -1608,7 +1608,7 @@ impl<T: Iterator<Item = char>> Scanner<T> {
16081608
fn fetch_key(&mut self) -> ScanResult {
16091609
let start_mark = self.mark;
16101610
if self.flow_level == 0 {
1611-
// Check if we are allowed to start a new key (not nessesary simple).
1611+
// Check if we are allowed to start a new key (not necessarily simple).
16121612
if !self.simple_key_allowed {
16131613
return Err(ScanError::new(
16141614
self.mark,

src/yaml.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ a1: &DEFAULT
528528
}
529529

530530
#[test]
531-
fn test_bad_hypen() {
531+
fn test_bad_hyphen() {
532532
// See: https://github.com/chyh1990/yaml-rust/issues/23
533533
let s = "{-";
534534
assert!(YamlLoader::load_from_str(&s).is_err());

0 commit comments

Comments
 (0)