From 3b15b1664e2856a2a7cf430676355c82f2aac65b Mon Sep 17 00:00:00 2001 From: Jason Shin Date: Thu, 1 Aug 2019 12:42:52 +1000 Subject: Explaining the reason why validation is performed in to_str of path.rs --- src/libstd/path.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/libstd') diff --git a/src/libstd/path.rs b/src/libstd/path.rs index 126bc3754da..21c4968bfbe 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. + /// Also it it worthwhile noting that validation is performed because Non-UTF-8 strings are + /// perfectly valid for some OS. /// /// [`&str`]: ../primitive.str.html /// -- cgit 1.4.1-3-g733a5 From 1aa4a578276b2a3f7c47dcea7ad75786982550d4 Mon Sep 17 00:00:00 2001 From: Jason Shin Date: Thu, 1 Aug 2019 13:55:01 +1000 Subject: Update src/libstd/path.rs to shorten the explanation for .to_str validation step Co-Authored-By: Mazdak Farrokhzad --- src/libstd/path.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libstd') diff --git a/src/libstd/path.rs b/src/libstd/path.rs index 21c4968bfbe..56fde77daac 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -1819,7 +1819,7 @@ 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 + /// Note that validation is performed because non-UTF-8 strings are /// perfectly valid for some OS. /// /// [`&str`]: ../primitive.str.html -- cgit 1.4.1-3-g733a5