Skip to content

Commit

Permalink
Fix rustdocs include_str! for libcnb (#466)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
edmorley authored Jul 14, 2022
1 parent 3c9637e commit d396d29
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions libcnb/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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;

0 comments on commit d396d29

Please sign in to comment.