Rollup merge of #89729 - jkugelman:must-use-core-std-constructors, r=joshtriplett
Add #[must_use] to core and std constructors Parent issue: #89692 r? ``@joshtriplett``
This commit is contained in:
@@ -1146,6 +1146,7 @@ impl PathBuf {
|
||||
/// let path = PathBuf::new();
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[must_use]
|
||||
#[inline]
|
||||
pub fn new() -> PathBuf {
|
||||
PathBuf { inner: OsString::new() }
|
||||
@@ -1170,6 +1171,7 @@ impl PathBuf {
|
||||
///
|
||||
/// [`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) }
|
||||
|
||||
Reference in New Issue
Block a user