Skip to content

Commit 275071b

Browse files
committed
cargo fmt --all --check
1 parent e5f0a8f commit 275071b

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

src/app_state.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ impl AppState {
8383
})?;
8484

8585
// replacer for rustbook url
86-
let url_replacer = base_url.as_ref().map(|url| {
87-
UrlReplacer::new(url)
88-
});
86+
let url_replacer = base_url.as_ref().map(|url| UrlReplacer::new(url));
8987

9088
let dir_canonical_path = term::canonicalize("exercises");
9189
let mut exercises = exercise_infos

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ mod init;
2121
mod list;
2222
mod run;
2323
mod term;
24-
mod watch;
2524
mod url_replacer;
25+
mod watch;
2626

2727
const CURRENT_FORMAT_VERSION: u8 = 1;
2828

src/url_replacer.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pub struct UrlReplacer {
2-
base_url: String
2+
base_url: String,
33
}
44

55
const EN_BASE_URL: &str = "https://doc.rust-lang.org/book";
@@ -13,9 +13,7 @@ impl UrlReplacer {
1313
base_url.to_owned()
1414
};
1515

16-
Self {
17-
base_url: url
18-
}
16+
Self { base_url: url }
1917
}
2018

2119
/// replace rustbook url
@@ -41,7 +39,6 @@ link: https://example.com/ch03-02-data-types.html";
4139
assert_eq!(hint, replacer.replace(hint));
4240
}
4341

44-
4542
#[test]
4643
fn replace_rustbook_url() {
4744
let replacer = UrlReplacer::new(&String::from(TEST_DOMAIN));
@@ -50,9 +47,12 @@ link: https://example.com/ch03-02-data-types.html";
5047
hints (...) lines (...)
5148
link: https://doc.rust-lang.org/book/ch03-02-data-types.html";
5249

53-
assert_eq!("\
50+
assert_eq!(
51+
"\
5452
hints (...) lines (...)
55-
link: https://doc.rust-kr.org/ch03-02-data-types.html", replacer.replace(hint));
53+
link: https://doc.rust-kr.org/ch03-02-data-types.html",
54+
replacer.replace(hint)
55+
);
5656
}
5757

5858
#[test]

0 commit comments

Comments
 (0)