/// let path = PathBuf::new();
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
+ #[must_use]
#[inline]
pub fn new() -> PathBuf {
PathBuf { inner: OsString::new() }
///
/// [`with_capacity`]: OsString::with_capacity
#[stable(feature = "path_buf_capacity", since = "1.44.0")]
+ #[must_use]
#[inline]
pub fn with_capacity(capacity: usize) -> PathBuf {
PathBuf { inner: OsString::with_capacity(capacity) }
/// println!("{}", path.display());
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
+ #[must_use = "this does not display the path, \
+ it returns an object that can be displayed"]
#[inline]
pub fn display(&self) -> Display<'_> {
Display { path: self }