Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

refactor: remove raw hashes that are unnecessary

Hamir Mahaldd2a38ac8098
diff --git a/harper-core/src/language_detection.rs b/harper-core/src/language_detection.rs
index 2c8378501..fff660454 100644
--- a/harper-core/src/language_detection.rs
+++ b/harper-core/src/language_detection.rs
@@ -106,7 +106,7 @@ mod tests {
#[test]
fn detects_python_fib() {
assert_not_english(
- r#"
+ r"
def fibIter(n):
if n < 2:
return n
@@ -115,7 +115,7 @@ def fibIter(n):
for _ in range(2, n):
fibPrev, fib = fib, fib + fibPrev
return fib
- "#,
+ ",
);
}
diff --git a/harper-core/src/lexing/email_address.rs b/harper-core/src/lexing/email_address.rs
index c034f3378..df2eb20ac 100644
--- a/harper-core/src/lexing/email_address.rs
+++ b/harper-core/src/lexing/email_address.rs
@@ -109,23 +109,23 @@ mod tests {
fn example_local_parts() -> impl Iterator<Item = Vec<char>> {
[
- r#"simple"#,
- r#"very.common"#,
- r#"x"#,
- r#"long.email-address-with-hyphens"#,
- r#"user.name+tag+sorting"#,
- r#"name/surname"#,
- r#"admin"#,
- r#"example"#,
+ r"simple",
+ r"very.common",
+ r"x",
+ r"long.email-address-with-hyphens",
+ r"user.name+tag+sorting",
+ r"name/surname",
+ r"admin",
+ r"example",
r#"" ""#,
r#""john..doe""#,
- r#"mailhost!username"#,
+ r"mailhost!username",
r#""very.(),:;<>[]\".VERY.\"very@\\ \"very\".unusual""#,
- r#"user%example.com"#,
- r#"user-"#,
- r#"postmaster"#,
- r#"postmaster"#,
- r#"_test"#,
+ r"user%example.com",
+ r"user-",
+ r"postmaster",
+ r"postmaster",
+ r"_test",
]
.into_iter()
.map(|s| s.chars().collect())
diff --git a/harper-core/src/lexing/hostname.rs b/harper-core/src/lexing/hostname.rs
index 7897373b9..6a130726f 100644
--- a/harper-core/src/lexing/hostname.rs
+++ b/harper-core/src/lexing/hostname.rs
@@ -25,20 +25,20 @@ pub mod tests {
pub fn example_domain_parts() -> impl Iterator<Item = Vec<char>> {
[
- r#"example.com"#,
- r#"example.com"#,
- r#"example.com"#,
- r#"and.subdomains.example.com"#,
- r#"example.com"#,
- r#"example.com"#,
- r#"example"#,
- r#"s.example"#,
- r#"example.org"#,
- r#"example.org"#,
- r#"example.org"#,
- r#"strange.example.com"#,
- r#"example.org"#,
- r#"example.org"#,
+ r"example.com",
+ r"example.com",
+ r"example.com",
+ r"and.subdomains.example.com",
+ r"example.com",
+ r"example.com",
+ r"example",
+ r"s.example",
+ r"example.org",
+ r"example.org",
+ r"example.org",
+ r"strange.example.com",
+ r"example.org",
+ r"example.org",
]
.into_iter()
.map(|s| s.chars().collect())
diff --git a/harper-core/src/parsers/markdown.rs b/harper-core/src/parsers/markdown.rs
index 89ed098b0..cc5331fd4 100644
--- a/harper-core/src/parsers/markdown.rs
+++ b/harper-core/src/parsers/markdown.rs
@@ -264,7 +264,7 @@ mod tests {
#[test]
fn survives_emojis() {
- let source = r#"🤷."#;
+ let source = r"🤷.";
Markdown.parse_str(source);
}
@@ -284,7 +284,7 @@ mod tests {
#[test]
fn math_becomes_unlintable() {
- let source = r#"$\Katex$ $\text{is}$ $\text{great}$."#;
+ let source = r"$\Katex$ $\text{is}$ $\text{great}$.";
let tokens = Markdown.parse_str(source);
assert_eq!(
@@ -302,7 +302,7 @@ mod tests {
#[test]
fn hidden_wikilink_text() {
- let source = r#"[[this is hidden|this is not]]"#;
+ let source = r"[[this is hidden|this is not]]";
let tokens = Markdown.parse_str(source);
@@ -322,7 +322,7 @@ mod tests {
#[test]
fn improper_wikilink_text() {
- let source = r#"this is shown|this is also shown]]"#;
+ let source = r"this is shown|this is also shown]]";
let tokens = Markdown.parse_str(source);
@@ -354,7 +354,7 @@ mod tests {
#[test]
fn normal_wikilink() {
- let source = r#"[[Wikilink]]"#;
+ let source = r"[[Wikilink]]";
let tokens = Markdown.parse_str(source);
let token_kinds = tokens.iter().map(|t| t.kind).collect::<Vec<_>>();
@@ -365,7 +365,7 @@ mod tests {
#[test]
fn html_is_unlintable() {
- let source = r#"The range of inputs from <ctrl-g> to ctrl-z"#;
+ let source = r"The range of inputs from <ctrl-g> to ctrl-z";
let tokens = Markdown.parse_str(source);
assert_eq!(tokens.iter_unlintables().count(), 1);
}