forc-doc 0.66.2

Build the documentation for the local package and all dependencies. The output is placed in `out/doc` in the same format as the project.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#![cfg(test)]
use crate::cli::Command;
use expect_test::Expect;
use std::path::{Path, PathBuf};

mod impl_trait;

pub(crate) fn check_file(doc_path: &Path, path_to_file: &PathBuf, expect: &Expect) {
    let path = doc_path.join(path_to_file);
    let actual = std::fs::read_to_string(path.clone())
        .unwrap_or_else(|_| panic!("failed to read file: {:?}", path));
    expect.assert_eq(&actual)
}

pub(crate) fn get_doc_dir(build_instructions: &Command) -> String {
    build_instructions.doc_path.to_owned().unwrap()
}