From 07c6cd8c28e8ba3810b2c40911be28fb214a34fe Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sun, 27 Feb 2022 21:15:06 +0100 Subject: [PATCH] Fix `cargo publish` error due to examples without path Without this, we get a strange error: ``` % cargo publish --dry-run Updating crates.io index Packaging textwrap v0.15.0 (/home/mg/src/textwrap) Verifying textwrap v0.15.0 (/home/mg/src/textwrap) error: failed to verify package tarball Caused by: failed to parse manifest at `/home/mg/src/textwrap/target/package/textwrap-0.15.0/Cargo.toml` Caused by: can't find `hyphenation` example at `examples/hyphenation.rs` or `examples/hyphenation/main.rs`. Please specify example.path if you want to use a non-default path. ``` This happens even though the file is there: ``` % ls examples/hyphenation.rs examples/hyphenation.rs ``` Specifying an explicit path helps and should let the release go through. --- Cargo.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 7806ddeb..d6fcc35e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,10 +14,12 @@ exclude = [".github/", ".gitignore", "benches/", "examples/", "fuzz/", "images/" [[example]] name = "hyphenation" +path = "examples/hyphenation.rs" required-features = ["hyphenation"] [[example]] name = "termwidth" +path = "examples/termwidth.rs" required-features = ["terminal_size"] [package.metadata.docs.rs]