Skip to content
2 changes: 1 addition & 1 deletion harper-core/src/linting/a_some_time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl ExprLinter for ASomeTime {
span: a_some_span,
lint_kind: LintKind::Usage,
suggestions,
message: "Remove the indefinite article `a` before `some`.".to_string(),
message: "Remove the indefinite article `a` before `some`.".to_owned(),
..Default::default()
})
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/adjective_of_a.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ impl Linter for AdjectiveOfA {
span: Span::new(adjective.span.start, a_or_an.span.end),
lint_kind: LintKind::Style,
suggestions,
message: "The word `of` is not needed here.".to_string(),
message: "The word `of` is not needed here.".to_owned(),
priority: 63,
});
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/after_later.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl ExprLinter for AfterLater {
Some(Lint {
span: toks.span()?,
lint_kind: LintKind::Redundancy,
message: "Don't use `later` following `after [a period of time]`".to_string(),
message: "Don't use `later` following `after [a period of time]`".to_owned(),
suggestions: vec![
Suggestion::replace_with_match_case(without_after, template_chars),
Suggestion::replace_with_match_case(without_later, template_chars),
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/all_hell_break_loose.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl ExprLinter for AllHellBreakLoose {
lint_kind: LintKind::Eggcorn,
span: outspan,
suggestions: vec![Suggestion::replace_with_match_case_str("loose", outchars)],
message: "The correct idiom is `all hell breaks loose`.".to_string(),
message: "The correct idiom is `all hell breaks loose`.".to_owned(),
..Default::default()
})
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/an_a.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl Linter for AnA {
replacement,
chars_first,
)],
message: "Incorrect indefinite article.".to_string(),
message: "Incorrect indefinite article.".to_owned(),
priority: 31,
})
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/and_the_like.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl ExprLinter for AndTheLike {
corrected.chars().collect(),
toks.span()?.get_content(src),
)],
message: "If you intended the idiom meaning `similar things`, the correct form is with `the like`.".to_string(),
message: "If you intended the idiom meaning `similar things`, the correct form is with `the like`.".to_owned(),
..Default::default()
})
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/another_thing_coming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl ExprLinter for AnotherThingComing {
"another thing coming",
toks.span()?.get_content(src),
)],
message: "Corrects `another think coming` to `another thing coming`".to_string(),
message: "Corrects `another think coming` to `another thing coming`".to_owned(),
priority: 63,
})
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/another_think_coming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl ExprLinter for AnotherThinkComing {
"another think coming",
toks.span()?.get_content(src),
)],
message: "Corrects `another thing coming` to `another think coming`".to_string(),
message: "Corrects `another thing coming` to `another think coming`".to_owned(),
priority: 63,
})
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/arrive_to.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl ExprLinter for ArriveTo {
span,
lint_kind: LintKind::Usage,
suggestions,
message: "If the noun is a destination, use 'at' or 'in' instead of 'to'.".to_string(),
message: "If the noun is a destination, use 'at' or 'in' instead of 'to'.".to_owned(),
..Default::default()
})
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/aspire_to.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl ExprLinter for AspireTo {
"to",
prep_s.get_content(src),
)],
message: "Use `aspire to` instead of `aspire for`.".to_string(),
message: "Use `aspire to` instead of `aspire for`.".to_owned(),
..Default::default()
})
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/avoid_contractions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ impl ExprLinter for AvoidContractions {
expansion,
tok.get_ch(src),
)],
message: "Consider expanding this contraction.".to_string(),
message: "Consider expanding this contraction.".to_owned(),
priority: 63,
})
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/avoid_curses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ impl ExprLinter for AvoidCurses {
span,
lint_kind: LintKind::WordChoice,
suggestions,
message: "Try to avoid offensive language.".to_string(),
message: "Try to avoid offensive language.".to_owned(),
..Default::default()
})
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/behind_the_scenes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl ExprLinter for BehindTheScenes {
span.get_content(src),
)]
.to_vec(),
message: "This idiom uses the plural `scenes`.".to_string(),
message: "This idiom uses the plural `scenes`.".to_owned(),
..Default::default()
})
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/best_of_all_time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl ExprLinter for BestOfAllTime {
span: times_span,
lint_kind: LintKind::WordChoice,
suggestions: vec![Suggestion::ReplaceWith(time_singular.to_vec())],
message: "This expression uses singular `time`".to_string(),
message: "This expression uses singular `time`".to_owned(),
..Default::default()
});
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/brand_brandish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl ExprLinter for BrandBrandish {
},
verb_chars,
)],
message: "`Brandish` means to wield a weapon. You probably mean `brand`.".to_string(),
message: "`Brandish` means to wield a weapon. You probably mean `brand`.".to_owned(),
..Default::default()
})
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/by_accident.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl ExprLinter for ByAccident {
span,
lint_kind: LintKind::Usage,
suggestions,
message: "Did you mean `by accident`?".to_string(),
message: "Did you mean `by accident`?".to_owned(),
..Default::default()
})
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/by_the_book.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl ExprLinter for ByTheBook {
"book",
span.get_content(src),
)],
message: "Did you mean the idiom `by the book`?".to_string(),
message: "Did you mean the idiom `by the book`?".to_owned(),
..Default::default()
})
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/cant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl ExprLinter for Cant {
span: token.span,
lint_kind: LintKind::Enhancement,
suggestions: vec![Suggestion::replace_with_match_case_str(cannot, jargon)],
message: "`Cant` is secret language or jargon. If that's not what you mean you should use `can't` here.".to_string(),
message: "`Cant` is secret language or jargon. If that's not what you mean you should use `can't` here.".to_owned(),
priority: 127,
})
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/correct_number_suffix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl Linter for CorrectNumberSuffix {
output.push(Lint {
span: suffix_span,
lint_kind: LintKind::Miscellaneous,
message: "This number needs a different suffix to sound right.".to_string(),
message: "This number needs a different suffix to sound right.".to_owned(),
suggestions: vec![Suggestion::ReplaceWith(correct_suffix.to_chars().to_vec())],
..Default::default()
})
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/crave_for.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl ExprLinter for CraveFor {
span,
lint_kind: LintKind::Usage,
suggestions: vec![Suggestion::Remove],
message: "The verb `crave` should not be followed by `for`.".to_string(),
message: "The verb `crave` should not be followed by `for`.".to_owned(),
..Default::default()
})
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/currency_placement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fn generate_lint_for_tokens(a: &Token, b: &Token, document: &Document) -> Option
span,
lint_kind: LintKind::Formatting,
suggestions: vec![Suggestion::ReplaceWith(correct)],
message: "The position of the currency symbol matters.".to_string(),
message: "The position of the currency symbol matters.".to_owned(),
priority: 63,
})
} else {
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/damages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ impl ExprLinter for Damages {
damage_chars[..6].to_vec(),
damage_chars,
)],
message: "Singular `damage` is correct when not referring to a court case.".to_string(),
message: "Singular `damage` is correct when not referring to a court case.".to_owned(),
..Default::default()
})
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/day_and_age.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ impl ExprLinter for DayAndAge {
replacement.chars().collect(),
span.get_content(src),
)],
message: "The correct idiom is `in this day and age`.".to_string(),
message: "The correct idiom is `in this day and age`.".to_owned(),
..Default::default()
})
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/despite_of.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl ExprLinter for DespiteOf {
Suggestion::replace_with_match_case_str("despite", matched),
Suggestion::replace_with_match_case_str("in spite of", matched)
],
message: "The phrase “despite of” is incorrect. Please use either “despite” or “in spite of” instead.".to_string(),
message: "The phrase “despite of” is incorrect. Please use either “despite” or “in spite of” instead.".to_owned(),
priority: 126,
})
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/did_past.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ where
.into_iter()
.map(|s| Suggestion::replace_with_match_case(s, vchars))
.collect(),
message: "Use the base form of the verb with \"did\".".to_string(),
message: "Use the base form of the verb with \"did\".".to_owned(),
..Default::default()
})
} else {
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/didnt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl ExprLinter for Didnt {
"didn't",
suspect.get_ch(src),
)],
message: "Consider using `didn't` here.".to_string(),
message: "Consider using `didn't` here.".to_owned(),
priority: 63,
})
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/do_mistake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl ExprLinter for DoMistake {
span,
lint_kind: LintKind::Usage,
suggestions: vec![Suggestion::replace_with_match_case(make, chars)],
message: "In English we `make` mistakes, not `do` them".to_string(),
message: "In English we `make` mistakes, not `do` them".to_owned(),
..Default::default()
})
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/double_modal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl ExprLinter for DoubleModal {
Suggestion::ReplaceWith(first_chars.into()),
Suggestion::ReplaceWith(second_chars.into()),
],
message: "Two modal verbs in a row are rarely grammatical; remove one.".to_string(),
message: "Two modal verbs in a row are rarely grammatical; remove one.".to_owned(),
priority: 31,
})
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/ellipsis_length.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl Linter for EllipsisLength {
span: tok.span,
lint_kind: LintKind::Formatting,
suggestions: vec![Suggestion::ReplaceWith(vec!['.', '.', '.'])],
message: "Horizontal ellipsis must have 3 dots.".to_string(),
message: "Horizontal ellipsis must have 3 dots.".to_owned(),
priority: 31,
})
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/ever_every.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl ExprLinter for EverEvery {
content[..content.len() - 1].to_vec(),
content,
)],
message: "Is this `every` a typo that should be `ever`?".to_string(),
message: "Is this `every` a typo that should be `ever`?".to_owned(),
..Default::default()
})
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/expand_people.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl ExprLinter for ExpandPeople {
"people",
span.get_content(src),
)];
let message = "Use `people` instead of `ppl`.".to_string();
let message = "Use `people` instead of `ppl`.".to_owned();
Some(Lint {
span,
lint_kind,
Expand Down
13 changes: 5 additions & 8 deletions harper-core/src/linting/expr_linter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ mod tests_context {
fn match_to_lint(&self, toks: &[Token], _src: &[char]) -> Option<Lint> {
Some(Lint {
span: toks.span()?,
message: "simple".to_string(),
message: "simple".to_owned(),
suggestions: vec![Suggestion::ReplaceWith(vec!['2'])],
..Default::default()
})
Expand Down Expand Up @@ -257,21 +257,18 @@ mod tests_context {
&& after.eq_ignore_ascii_case(" three")
{
(
"ascending".to_string(),
"ascending".to_owned(),
vec![Suggestion::ReplaceWith(vec!['>'])],
)
} else if before.eq_ignore_ascii_case("three ")
&& after.eq_ignore_ascii_case(" one")
{
(
"descending".to_string(),
"descending".to_owned(),
vec![Suggestion::ReplaceWith(vec!['<'])],
)
} else {
(
"dunno".to_string(),
vec![Suggestion::ReplaceWith(vec!['?'])],
)
("dunno".to_owned(), vec![Suggestion::ReplaceWith(vec!['?'])])
};

return Some(Lint {
Expand Down Expand Up @@ -312,7 +309,7 @@ mod tests_context {
fn match_to_lint(&self, toks: &[Token], _src: &[char]) -> Option<Lint> {
Some(Lint {
span: toks.span()?,
message: "sentence".to_string(),
message: "sentence".to_owned(),
suggestions: vec![Suggestion::ReplaceWith(vec!['2', '&', '2'])],
..Default::default()
})
Expand Down
4 changes: 2 additions & 2 deletions harper-core/src/linting/far_be_it.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ impl ExprLinter for FarBeIt {
vec!['f', 'r', 'o', 'm'],
content,
)],
"`Far be it for` is a common error for `far be it from`".to_string(),
"`Far be it for` is a common error for `far be it from`".to_owned(),
)
} else {
(vec![], "The correct usage of the idiom is `far be it from` [someone] to [do something]. Try to rephrase the sentence.".to_string())
(vec![], "The correct usage of the idiom is `far be it from` [someone] to [do something]. Try to rephrase the sentence.".to_owned())
};

Some(Lint {
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/fed_up_with.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl ExprLinter for FedUpWith {
"with",
ofspan.get_content(src),
)],
message: "`Fed up of` is not accepted outside of British English.".to_string(),
message: "`Fed up of` is not accepted outside of British English.".to_owned(),
..Default::default()
})
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/feel_fell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl ExprLinter for FeelFell {
"feel",
fell_token.get_ch(src),
)],
message: "It looks like this is a typo, did you mean `feel`?".to_string(),
message: "It looks like this is a typo, did you mean `feel`?".to_owned(),
..Default::default()
})
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/fellow_co_redundancy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl ExprLinter for FellowCoRedundancy {
Suggestion::ReplaceWith(cf.iter().chain(worker.iter()).copied().collect())
})
.into(),
message: "Using `fellow` with `co` is redundant.".to_string(),
message: "Using `fellow` with `co` is redundant.".to_owned(),
..Default::default()
})
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/filler_words.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl ExprLinter for FillerWords {
span: toks.span()?,
lint_kind: LintKind::Miscellaneous,
suggestions: vec![Suggestion::Remove],
message: "Remove this unnecessary filler word.".to_string(),
message: "Remove this unnecessary filler word.".to_owned(),
priority: 31,
})
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/first_aid_kit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl ExprLinter for FirstAidKit {
"kit".chars().collect(),
typo_text,
)],
message: "Did you mean `kit` (a set of items) instead of “kid”?".to_string(),
message: "Did you mean `kit` (a set of items) instead of “kid”?".to_owned(),
priority: 31,
})
}
Expand Down
Loading
Loading