Explaining the reason why validation is performed in to_str of path.rs

This commit is contained in:
Jason Shin
2019-08-01 12:42:52 +10:00
parent 8a58268b5a
commit 3b15b1664e

View File

@@ -1819,6 +1819,8 @@ impl Path {
/// Yields a [`&str`] slice if the `Path` is valid unicode.
///
/// This conversion may entail doing a check for UTF-8 validity.
/// Also it it worthwhile noting that validation is performed because Non-UTF-8 strings are
/// perfectly valid for some OS.
///
/// [`&str`]: ../primitive.str.html
///