1
Fork 0

Rollup merge of #91782 - maxwase:is_symlink_since_attribute, r=jyn514

Correct since attribute for `is_symlink` feature

Follow-up from [89677](https://github.com/rust-lang/rust/pull/89677)
This commit is contained in:
Matthias Krüger 2021-12-11 16:02:50 +01:00 committed by GitHub
commit bb23d82e6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -1058,7 +1058,7 @@ impl Metadata {
/// }
/// ```
#[must_use]
#[stable(feature = "is_symlink", since = "1.57.0")]
#[stable(feature = "is_symlink", since = "1.58.0")]
pub fn is_symlink(&self) -> bool {
self.file_type().is_symlink()
}

View file

@ -2817,7 +2817,7 @@ impl Path {
/// check errors, call [`fs::symlink_metadata`] and handle its [`Result`]. Then call
/// [`fs::Metadata::is_symlink`] if it was [`Ok`].
#[must_use]
#[stable(feature = "is_symlink", since = "1.57.0")]
#[stable(feature = "is_symlink", since = "1.58.0")]
pub fn is_symlink(&self) -> bool {
fs::symlink_metadata(self).map(|m| m.is_symlink()).unwrap_or(false)
}