Commit cb1a90d
authored
Rollup merge of rust-lang#123716 - Kriskras99:patch-2, r=Mark-Simulacrum
Update documentation of Path::to_path_buf and Path::ancestors
`Path::to_path_buf`
> Changes the example from using the qualified path of PathBuf with an import. This is what's done in all other Path/PathBuf examples and makes the code look a bit cleaner.
`Path::ancestors`
> If you take a quick glance at the documentation for Path::ancestors, the unwraps take the natural focus. Potentially indicating that ancestors might panic.
In the reworked version I've also moved the link with parent returning None and that the iterator will always yield &self to before the yield examples.
Feel free to cherry-pick the changes you like.1 file changed
+5
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2143 | 2143 | | |
2144 | 2144 | | |
2145 | 2145 | | |
2146 | | - | |
| 2146 | + | |
2147 | 2147 | | |
2148 | 2148 | | |
2149 | | - | |
| 2149 | + | |
2150 | 2150 | | |
2151 | 2151 | | |
2152 | 2152 | | |
| |||
2278 | 2278 | | |
2279 | 2279 | | |
2280 | 2280 | | |
2281 | | - | |
2282 | | - | |
2283 | | - | |
2284 | | - | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
2285 | 2284 | | |
2286 | 2285 | | |
2287 | 2286 | | |
| |||
0 commit comments