Rollup merge of #82196 - Manishearth:display-caveat, r=m-ou-se

Add caveat to Path::display() about lossiness

It's worth calling out that this API may do a lossy display.

r? ```@m-ou-se```
This commit is contained in:
Guillaume Gomez 2021-02-17 20:38:03 +01:00 committed by GitHub
commit 8e6bc14f52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -2321,7 +2321,9 @@ impl Path {
}
/// Returns an object that implements [`Display`] for safely printing paths
/// that may contain non-Unicode data.
/// that may contain non-Unicode data. This may perform lossy conversion,
/// depending on the platform. If you would like an implementation which
/// escapes the path please use [`Debug`] instead.
///
/// [`Display`]: fmt::Display
///
@ -2555,7 +2557,9 @@ impl fmt::Debug for Path {
///
/// A [`Path`] might contain non-Unicode data. This `struct` implements the
/// [`Display`] trait in a way that mitigates that. It is created by the
/// [`display`](Path::display) method on [`Path`].
/// [`display`](Path::display) method on [`Path`]. This may perform lossy
/// conversion, depending on the platform. If you would like an implementation
/// which escapes the path please use [`Debug`] instead.
///
/// # Examples
///