Skip to content

Commit 5e086c8

Browse files
committed
some cleanup/fixes
1 parent adc8cd9 commit 5e086c8

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/tools/rustbook/src/main.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ use clap::{App, AppSettings, ArgMatches, SubCommand};
88
use mdbook::errors::Result as Result3;
99
use mdbook::MDBook;
1010

11-
#[cfg(feature = "linkcheck")]
12-
use mdbook::renderer::RenderContext;
13-
1411
fn main() {
1512
let d_message = "-d, --dest-dir=[dest-dir]
1613
'The output directory for your book{n}(Defaults to ./book when omitted)'";
@@ -87,14 +84,12 @@ pub fn linkcheck(
8784
use mdbook_linkcheck::Reason;
8885

8986
let book_dir = get_book_dir(args);
90-
let src_dir = get_book_dir(args).join("src");
87+
let src_dir = book_dir.join("src");
9188
let book = MDBook::load(&book_dir).unwrap();
9289
let linkck_cfg = mdbook_linkcheck::get_config(&book.config)?;
9390
let mut files = codespan::Files::new();
9491
let target_files = mdbook_linkcheck::load_files_into_memory(&book.book, &mut files);
95-
let render_ctx = RenderContext::new(&book_dir, book.book, book.config, &book_dir);
96-
let cache_file = render_ctx.destination.join("cache.json");
97-
let cache = mdbook_linkcheck::Cache::load(std::fs::File::open(cache_file)?)?;
92+
let cache = mdbook_linkcheck::Cache::default();
9893

9994
let (links, incomplete) = mdbook_linkcheck::extract_links(target_files, &files);
10095

0 commit comments

Comments
 (0)