[Clippy] Swap open_options to use diagnostic items instead of paths

This commit is contained in:
GnomedDev
2024-09-19 12:19:48 +01:00
parent 364e552940
commit b2eebeeea9
4 changed files with 16 additions and 13 deletions

View File

@@ -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 {