From 71125d5c3b280f9e1aad4b7e2fd527e6e58256e7 Mon Sep 17 00:00:00 2001 From: Wouter Geraedts Date: Sun, 13 Oct 2019 21:19:23 +0200 Subject: [PATCH] Implemented PathBuf::new --- src/path/pathbuf.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/path/pathbuf.rs b/src/path/pathbuf.rs index 5403967d..2d6ba19e 100644 --- a/src/path/pathbuf.rs +++ b/src/path/pathbuf.rs @@ -51,6 +51,19 @@ impl PathBuf { pub fn into_os_string(self) -> OsString { self.inner.into_os_string() } + + /// Allocates an empty `PathBuf`. + /// + /// # Examples + /// + /// ``` + /// use async_std::path::PathBuf; + /// + /// let path = PathBuf::new(); + /// ``` + pub fn new() -> PathBuf { + std::path::PathBuf::new().into() + } } impl From for PathBuf {