From 5d186c77a63436f67dcb8a4930aa3618500f4640 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 18 Dec 2022 09:31:16 -0800 Subject: [PATCH] Opt out -Zrustdoc-scrape-examples on docs.rs I'd like a chance to audit all the code that rustdoc is inserting into the docs. Currently I am skeptical that showing serde's internal usages of APIs is a net benefit to the public documentation. I am also skeptical that quite so many examples are needed, and that they should be featured so prominently in comparison to handwritten docs. Lastly I wish there were a way to turn this behavior off on a more granular basis. --- serde/Cargo.toml | 3 +++ serde_test/Cargo.toml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/serde/Cargo.toml b/serde/Cargo.toml index 0f1a8daa..e720eaea 100644 --- a/serde/Cargo.toml +++ b/serde/Cargo.toml @@ -20,6 +20,9 @@ serde_derive = { version = "=1.0.151", optional = true, path = "../serde_derive" [dev-dependencies] serde_derive = { version = "1.0", path = "../serde_derive" } +[lib] +doc-scrape-examples = false + [package.metadata.playground] features = ["derive", "rc"] diff --git a/serde_test/Cargo.toml b/serde_test/Cargo.toml index 4dc37e31..279a10c0 100644 --- a/serde_test/Cargo.toml +++ b/serde_test/Cargo.toml @@ -21,5 +21,8 @@ serde = { version = "1.0.60", path = "../serde" } serde = { version = "1.0", path = "../serde" } serde_derive = { version = "1.0", path = "../serde_derive" } +[lib] +doc-scrape-examples = false + [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"]