File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -415,6 +415,27 @@ impl Path {
415
415
self . inner . iter ( )
416
416
}
417
417
418
+ /// Creates an owned [`PathBuf`] with `path` adjoined to `self`.
419
+ ///
420
+ /// See [`PathBuf::push`] for more details on what it means to adjoin a path.
421
+ ///
422
+ /// [`PathBuf`]: struct.PathBuf.html
423
+ /// [`PathBuf::push`]: struct.PathBuf.html#method.push
424
+ ///
425
+ /// # Examples
426
+ ///
427
+ /// ```
428
+ /// use async_std::path::{Path, PathBuf};
429
+ ///
430
+ /// assert_eq!(Path::new("/etc").join("passwd"), PathBuf::from("/etc/passwd"));
431
+ /// ```
432
+ pub fn join < P : AsRef < Path > > ( & self , path : P ) -> PathBuf
433
+ where
434
+ P : std:: convert:: AsRef < std:: path:: Path > ,
435
+ {
436
+ self . inner . join ( path) . into ( )
437
+ }
438
+
418
439
/// Queries the file system to get information about a file, directory, etc.
419
440
///
420
441
/// This function will traverse symbolic links to query information about the
You can’t perform that action at this time.
0 commit comments