From cb771b22bc6f2581973a35076d01bc5ba0ccdb81 Mon Sep 17 00:00:00 2001 From: GnomedDev Date: Thu, 19 Sep 2024 12:19:48 +0100 Subject: [PATCH] [Clippy] Swap `open_options` to use diagnostic items instead of paths --- std/src/fs.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/std/src/fs.rs b/std/src/fs.rs index abf7d5d294af4..92d3838d9f28f 100644 --- a/std/src/fs.rs +++ b/std/src/fs.rs @@ -466,6 +466,7 @@ impl File { /// ``` #[must_use] #[stable(feature = "with_options", since = "1.58.0")] + #[cfg_attr(not(test), rustc_diagnostic_item = "file_options")] pub fn options() -> OpenOptions { OpenOptions::new() } @@ -1009,6 +1010,7 @@ impl OpenOptions { /// let mut options = OpenOptions::new(); /// let file = options.read(true).open("foo.txt"); /// ``` + #[cfg_attr(not(test), rustc_diagnostic_item = "open_options_new")] #[stable(feature = "rust1", since = "1.0.0")] #[must_use] pub fn new() -> Self {