diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-08-06 08:17:36 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-06 08:17:36 +0200 |
| commit | e98823025fe600dbe2d1385abec2804d0a8e0b2f (patch) | |
| tree | eabd8600e45dd46bf0f5118e9b99fb78ff982bbc /src/libstd | |
| parent | 61e270ab4866d5f1920a42809a3b7016e0d59298 (diff) | |
| parent | 1aa4a578276b2a3f7c47dcea7ad75786982550d4 (diff) | |
| download | rust-e98823025fe600dbe2d1385abec2804d0a8e0b2f.tar.gz rust-e98823025fe600dbe2d1385abec2804d0a8e0b2f.zip | |
Rollup merge of #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).
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/path.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libstd/path.rs b/src/libstd/path.rs index 126bc3754da..56fde77daac 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -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 /// |
