This commit is contained in:
Austen Adler 2024-05-23 11:13:38 -04:00
parent c546432de4
commit 69062c4c39

View File

@ -1,5 +1,4 @@
#![feature(try_blocks)]
#![feature(absolute_path)]
use anyhow::bail;
use anyhow::Context;
use anyhow::Result;
@ -172,8 +171,7 @@ async fn build_docs() -> Result<LocalDocsPath> {
let root_path = output_path
.parent()
.map(|p| p.parent())
.flatten()
.and_then(|p| p.parent())
.context("Crate docs directory is invalid")?;
if !root_path.is_dir() {
@ -210,9 +208,17 @@ struct LocalDocsPath {
#[serde(tag = "reason")]
#[serde(rename_all = "kebab-case")]
enum CargoDocLine {
CompilerArtifact { filenames: Vec<PathBuf> },
BuildFinished { success: bool },
CompilerArtifact {
filenames: Vec<PathBuf>,
},
BuildFinished {
success: bool,
},
// This is dead code, but serde won't deserialize if I use `()`, since it expects a map
// I could probably tell serde to deserialize the insides as a map, but it doesn't matter
#[allow(dead_code)]
BuildScriptExecuted(Value),
#[allow(dead_code)]
CompilerMessage(Value),
}
@ -228,8 +234,7 @@ async fn get_std_docs_path() -> Result<PathBuf> {
));
let path = path
.parent()
.map(|p| p.parent())
.flatten()
.and_then(|p| p.parent())
.context("std docs directory is invalid")?;
if !path.is_dir() {