From d396d298cda82bcbd612c33739caf179d6c336ee Mon Sep 17 00:00:00 2001 From: Ed Morley <501702+edmorley@users.noreply.github.com> Date: Thu, 14 Jul 2022 12:09:01 +0100 Subject: [PATCH] Fix rustdocs `include_str!` for libcnb (#466) Followup to #460. Previously it was referencing the repo root file, which doesn't exist when the package is published (since at that point it's no longer in a monorepo). Now, the package root `README.md` is used instead, which is a symlink to the repo root `README.md` in the monorepo, and when the package is published is the resolved README from: https://github.com/heroku/libcnb.rs/blob/3c9637e238d23d3fec402f27c81fa8a13b1a5a6d/libcnb/Cargo.toml#L11-L12 The redundant doctest readme include has also been removed. GUS-W-11395978. --- libcnb/src/lib.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/libcnb/src/lib.rs b/libcnb/src/lib.rs index ae2c0872..d2cc1872 100644 --- a/libcnb/src/lib.rs +++ b/libcnb/src/lib.rs @@ -1,4 +1,4 @@ -#![doc = include_str!("../../README.md")] +#![doc = include_str!("../README.md")] #![warn(clippy::pedantic)] #![warn(unused_crate_dependencies)] // Most of libcnb's public API returns user-provided errors, making error docs redundant. @@ -119,9 +119,3 @@ macro_rules! additional_buildpack_binary_path { ) }; } - -// This runs the README.md as a doctest, ensuring the code examples in it are valid. -// It will not be part of the final crate. -#[cfg(doctest)] -#[doc = include_str!("../../README.md")] -pub struct ReadmeDoctests;