Skip to content

Commit e988230

Browse files
authored
Rollup merge of rust-lang#63184 - JasonShin:master, r=sfackler
Explaining the reason why validation is performed in to_str of path.rs I thought it's good to explain the reason for the validation during the conversion between Path/PathBuffer into str, which explains the reason for returning an Option at this point (good for beginners who are reading through the docs).
2 parents 61e270a + 1aa4a57 commit e988230

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: src/libstd/path.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1819,6 +1819,8 @@ impl Path {
18191819
/// Yields a [`&str`] slice if the `Path` is valid unicode.
18201820
///
18211821
/// This conversion may entail doing a check for UTF-8 validity.
1822+
/// Note that validation is performed because non-UTF-8 strings are
1823+
/// perfectly valid for some OS.
18221824
///
18231825
/// [`&str`]: ../primitive.str.html
18241826
///

0 commit comments

Comments
 (0)