5132: Fix some typos r=matklad a=davidlattimore



Co-authored-by: David Lattimore <dml@google.com>
This commit is contained in:
bors[bot] 2020-06-30 08:45:16 +00:00 committed by GitHub
commit e87cba85ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 7 deletions

View file

@ -4,7 +4,7 @@ use ra_ide_db::{symbol_index::SymbolsDatabase, RootDatabase};
use crate::SourceFileEdit; use crate::SourceFileEdit;
use ra_ssr::{MatchFinder, SsrError, SsrRule}; use ra_ssr::{MatchFinder, SsrError, SsrRule};
// Feature: Structural Seach and Replace // Feature: Structural Search and Replace
// //
// Search and replace with named wildcards that will match any expression, type, path, pattern or item. // Search and replace with named wildcards that will match any expression, type, path, pattern or item.
// The syntax for a structural search replace command is `<search_pattern> ==>> <replace_pattern>`. // The syntax for a structural search replace command is `<search_pattern> ==>> <replace_pattern>`.

View file

@ -225,7 +225,7 @@ impl<'db, 'sema> MatchState<'db, 'sema> {
match self.next_non_trivial(&mut code_it) { match self.next_non_trivial(&mut code_it) {
None => { None => {
if let Some(p) = pattern_it.next() { if let Some(p) = pattern_it.next() {
fail_match!("Part of the pattern was unmached: {:?}", p); fail_match!("Part of the pattern was unmatched: {:?}", p);
} }
return Ok(()); return Ok(());
} }

View file

@ -55,7 +55,7 @@ impl FromStr for SsrRule {
let pattern = it.next().expect("at least empty string").trim(); let pattern = it.next().expect("at least empty string").trim();
let template = it let template = it
.next() .next()
.ok_or_else(|| SsrError("Cannot find delemiter `==>>`".into()))? .ok_or_else(|| SsrError("Cannot find delimiter `==>>`".into()))?
.trim() .trim()
.to_string(); .to_string();
if it.next().is_some() { if it.next().is_some() {

View file

@ -152,12 +152,12 @@ fn parse_error_text(query: &str) -> String {
#[test] #[test]
fn parser_empty_query() { fn parser_empty_query() {
assert_eq!(parse_error_text(""), "Parse error: Cannot find delemiter `==>>`"); assert_eq!(parse_error_text(""), "Parse error: Cannot find delimiter `==>>`");
} }
#[test] #[test]
fn parser_no_delimiter() { fn parser_no_delimiter() {
assert_eq!(parse_error_text("foo()"), "Parse error: Cannot find delemiter `==>>`"); assert_eq!(parse_error_text("foo()"), "Parse error: Cannot find delimiter `==>>`");
} }
#[test] #[test]
@ -227,7 +227,7 @@ fn assert_ssr_transforms(rules: &[&str], input: &str, result: &str) {
let mut after = db.file_text(file_id).to_string(); let mut after = db.file_text(file_id).to_string();
edits.apply(&mut after); edits.apply(&mut after);
// Likewise, we need to make sure that whatever transformations fixture parsing applies, // Likewise, we need to make sure that whatever transformations fixture parsing applies,
// also get appplied to our expected result. // also get applied to our expected result.
let result = normalize_code(result); let result = normalize_code(result);
assert_eq!(after, result); assert_eq!(after, result);
} else { } else {

View file

@ -98,7 +98,7 @@ USAGE:
rust-analyzer parse [FLAGS] rust-analyzer parse [FLAGS]
FLAGS: FLAGS:
-h, --help Prints help inforamtion -h, --help Prints help information
--no-dump" --no-dump"
); );
return Ok(Err(HelpPrinted)); return Ok(Err(HelpPrinted));