Skip to content

Commit 1293b32

Browse files
committed
Fix typos prase -> parse
1 parent 77994ca commit 1293b32

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/main.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -685,50 +685,50 @@ mod tests {
685685
/// which have a comment `<!-- test_config -->` at the previous line
686686
fn readme_config() {
687687
#[derive(Debug, PartialEq)]
688-
enum PraseState {
688+
enum ParseState {
689689
Nothing,
690690
FoundComment,
691691
ConfigFile
692692
}
693693

694694
let readme = include_bytes!("../README.md");
695-
let mut prase_state = PraseState::Nothing;
695+
let mut parse_state = ParseState::Nothing;
696696
let mut config_files: Vec<String> = Default::default();
697697
let mut current_config_files: String = Default::default();
698698
for line in readme.lines() {
699699
let line = line.unwrap();
700700
let line = line.trim();
701701
if line == "<!-- test_config -->" {
702-
if prase_state != PraseState::Nothing {
703-
panic!("prase readme error:\nfound test comment while not in state PraseState::Nothing\nIs in state {prase_state:?}");
702+
if parse_state != ParseState::Nothing {
703+
panic!("parse readme error:\nfound test comment while not in state ParseState::Nothing\nIs in state {parse_state:?}");
704704
}
705-
prase_state = PraseState::FoundComment;
705+
parse_state = ParseState::FoundComment;
706706
continue;
707707
}
708-
if line.starts_with("```") && prase_state == PraseState::FoundComment {
709-
prase_state = PraseState::ConfigFile;
708+
if line.starts_with("```") && parse_state == ParseState::FoundComment {
709+
parse_state = ParseState::ConfigFile;
710710
continue;
711711
}
712-
if line.starts_with("```") && prase_state == PraseState::ConfigFile {
713-
prase_state = PraseState::Nothing;
712+
if line.starts_with("```") && parse_state == ParseState::ConfigFile {
713+
parse_state = ParseState::Nothing;
714714
config_files.push(take(&mut current_config_files));
715715
continue;
716716
}
717-
if prase_state == PraseState::ConfigFile {
717+
if parse_state == ParseState::ConfigFile {
718718
current_config_files.push_str(line);
719719
current_config_files.push('\n');
720720
}
721721
}
722-
if prase_state != PraseState::Nothing {
723-
panic!("prase readme error:\nUnexpected end of file. Praser is still in state {prase_state:?}");
722+
if parse_state != ParseState::Nothing {
723+
panic!("parse readme error:\nUnexpected end of file. Parser is still in state {parse_state:?}");
724724
}
725725
if config_files.is_empty() {
726726
panic!("no config files found at README.md");
727727
}
728728
println!("found {} configs in readme", config_files.len());
729729
for (i, config) in config_files.iter().enumerate() {
730-
println!("\n\nprase {}. config", i + 1);
731-
println!("prase:\n{config}");
730+
println!("\n\nparse {}. config", i + 1);
731+
println!("parse:\n{config}");
732732
let _: super::Config = unwrap_dis(toml::from_str(config));
733733
}
734734
}

0 commit comments

Comments
 (0)