File tree Expand file tree Collapse file tree 3 files changed +9
-11
lines changed
Expand file tree Collapse file tree 3 files changed +9
-11
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -21,8 +21,8 @@ mod init;
2121mod list;
2222mod run;
2323mod term;
24- mod watch;
2524mod url_replacer;
25+ mod watch;
2626
2727const CURRENT_FORMAT_VERSION : u8 = 1 ;
2828
Original file line number Diff line number Diff line change 11pub struct UrlReplacer {
2- base_url : String
2+ base_url : String ,
33}
44
55const 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 (...)
5148link: 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]
You can’t perform that action at this time.
0 commit comments