Rollup merge of #146299 - smirzaei:doc/improve-path-canonicalize-docs, r=jhpratt
docs(std): add error docs for path canonicalize This PR adds the missing error documentation for both [Path.canonicalize](https://doc.rust-lang.org/std/path/struct.Path.html#method.canonicalize) and [PathBuf.canonicalize](https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.canonicalize) methods. Since both methods are wappers around [fs::canonicalize](https://doc.rust-lang.org/std/fs/fn.canonicalize.html), the error doc is copied directly from that function. This makes it faster to find what errors might arise when calling `path.canonicalize` or `path_buf.canonicalize` in the editor itself without needing to drill down to the `fs::canonicalzie` docs.
This commit is contained in:
commit
d1ab870a07
1 changed files with 8 additions and 0 deletions
|
|
@ -3037,6 +3037,14 @@ impl Path {
|
|||
///
|
||||
/// This is an alias to [`fs::canonicalize`].
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// This method will return an error in the following situations, but is not
|
||||
/// limited to just these cases:
|
||||
///
|
||||
/// * `path` does not exist.
|
||||
/// * A non-final component in path is not a directory.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue