File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,10 @@ between `Path` and `PathBuf` is similar to that of `str` and `String`:
13
13
a ` PathBuf ` can be mutated in-place, and can be dereferenced to a ` Path ` .
14
14
15
15
Note that a ` Path ` is * not* internally represented as an UTF-8 string, but
16
- instead is stored as a vector of bytes (` Vec<u8> ` ). Therefore, converting a
17
- ` Path ` to a ` &str ` is * not* free and may fail (an ` Option ` is returned).
16
+ instead is stored as an ` OsString ` . Therefore, converting a ` Path ` to a ` &str `
17
+ is * not* free and may fail (an ` Option ` is returned). However, a ` Path ` can be
18
+ freely converted to an ` OsString ` or ` &OsStr ` using ` into_os_string ` and
19
+ ` as_os_str ` , respectively.
18
20
19
21
``` rust,editable
20
22
use std::path::Path;
You can’t perform that action at this time.
0 commit comments