Skip to content

Commit

Permalink
Rollup merge of rust-lang#63184 - JasonShin:master, r=sfackler
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
Centril authored Aug 6, 2019
2 parents 61e270a + 1aa4a57 commit e988230
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libstd/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
/// Note that validation is performed because non-UTF-8 strings are
/// perfectly valid for some OS.
///
/// [`&str`]: ../primitive.str.html
///
Expand Down

0 comments on commit e988230

Please sign in to comment.