Add #[must_use] to is_condition tests

A continuation of #89718.
This commit is contained in:
John Kugelman
2021-10-11 21:15:57 -04:00
parent 7cc8c44871
commit 01b439e764
6 changed files with 47 additions and 0 deletions

View File

@@ -1005,6 +1005,7 @@ impl Metadata {
/// Ok(())
/// }
/// ```
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn is_dir(&self) -> bool {
self.file_type().is_dir()
@@ -1033,6 +1034,7 @@ impl Metadata {
/// Ok(())
/// }
/// ```
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn is_file(&self) -> bool {
self.file_type().is_file()
@@ -1059,6 +1061,7 @@ impl Metadata {
/// Ok(())
/// }
/// ```
#[must_use]
#[unstable(feature = "is_symlink", issue = "85748")]
pub fn is_symlink(&self) -> bool {
self.file_type().is_symlink()
@@ -1306,6 +1309,7 @@ impl FileType {
/// Ok(())
/// }
/// ```
#[must_use]
#[stable(feature = "file_type", since = "1.1.0")]
pub fn is_dir(&self) -> bool {
self.0.is_dir()
@@ -1338,6 +1342,7 @@ impl FileType {
/// Ok(())
/// }
/// ```
#[must_use]
#[stable(feature = "file_type", since = "1.1.0")]
pub fn is_file(&self) -> bool {
self.0.is_file()
@@ -1373,6 +1378,7 @@ impl FileType {
/// Ok(())
/// }
/// ```
#[must_use]
#[stable(feature = "file_type", since = "1.1.0")]
pub fn is_symlink(&self) -> bool {
self.0.is_symlink()