From 3f015a363020d3811e1f028c9ce4b0705c728289 Mon Sep 17 00:00:00 2001 From: koka Date: Thu, 17 Nov 2022 00:02:22 +0900 Subject: [PATCH] Avoid generating files via doctest When we run `cargo test` in `clippy_lints` directory, it will generate `foo.txt` in the directory. In order to avoid that, add `no_run` to rustdoc which contains `File::create`. --- clippy_lints/foo.txt | 1 - clippy_lints/src/methods/mod.rs | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) delete mode 100644 clippy_lints/foo.txt diff --git a/clippy_lints/foo.txt b/clippy_lints/foo.txt deleted file mode 100644 index 5ab2f8a43..000000000 --- a/clippy_lints/foo.txt +++ /dev/null @@ -1 +0,0 @@ -Hello \ No newline at end of file diff --git a/clippy_lints/src/methods/mod.rs b/clippy_lints/src/methods/mod.rs index 43507f17e..acb3b20a6 100644 --- a/clippy_lints/src/methods/mod.rs +++ b/clippy_lints/src/methods/mod.rs @@ -3077,7 +3077,7 @@ declare_clippy_lint! { /// /// ### Example /// - /// ```rust + /// ```rust,no_run /// use std::fs::File; /// use std::io::{self, Write, Seek, SeekFrom}; /// @@ -3090,7 +3090,7 @@ declare_clippy_lint! { /// } /// ``` /// Use instead: - /// ```rust + /// ```rust,no_run /// use std::fs::File; /// use std::io::{self, Write, Seek, SeekFrom}; ///