diff --git a/src/main.rs b/src/main.rs index ad47086..44b01a9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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 { 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 }, - BuildFinished { success: bool }, + CompilerArtifact { + filenames: Vec, + }, + 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 { )); let path = path .parent() - .map(|p| p.parent()) - .flatten() + .and_then(|p| p.parent()) .context("std docs directory is invalid")?; if !path.is_dir() {