File tree Expand file tree Collapse file tree 3 files changed +3
-5
lines changed Expand file tree Collapse file tree 3 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,6 @@ mod theme;
2424mod toc;
2525
2626mod prelude {
27- pub use crate :: book_test:: BookTest ;
27+ pub use crate :: book_test:: { BookTest , read_to_string } ;
2828 pub use snapbox:: str;
2929}
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ use std::path::Path;
77
88fn read_book_index ( root : & Path ) -> serde_json:: Value {
99 let index = root. join ( "book/searchindex.js" ) ;
10- let index = std :: fs :: read_to_string ( index) . unwrap ( ) ;
10+ let index = read_to_string ( index) ;
1111 let index =
1212 index. trim_start_matches ( "window.search = Object.assign(window.search, JSON.parse('" ) ;
1313 let index = index. trim_end_matches ( "'));" ) ;
Original file line number Diff line number Diff line change 11//! Tests for table of contents (sidebar).
22
33use crate :: prelude:: * ;
4- use anyhow:: Context ;
54use anyhow:: Result ;
65use select:: document:: Document ;
76use select:: predicate:: { Attr , Class , Name , Predicate } ;
8- use std:: fs;
97
108const TOC_TOP_LEVEL : & [ & str ] = & [
119 "1. With Readme" ,
@@ -50,7 +48,7 @@ fn toc_fallback_html() -> Result<Document> {
5048 test. build ( ) ;
5149
5250 let toc_path = test. dir . join ( "book" ) . join ( "toc.html" ) ;
53- let html = fs :: read_to_string ( toc_path) . with_context ( || "Unable to read index.html" ) ? ;
51+ let html = read_to_string ( toc_path) ;
5452 Ok ( Document :: from ( html. as_str ( ) ) )
5553}
5654
You can’t perform that action at this time.
0 commit comments