Inline PathBuf::deref to make it zero cost

This commit is contained in:
Lzu Tao
2020-01-10 18:48:15 +00:00
parent 137a31d692
commit eca1e8bd9b

View File

@@ -1535,7 +1535,7 @@ impl fmt::Debug for PathBuf {
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl ops::Deref for PathBuf { impl ops::Deref for PathBuf {
type Target = Path; type Target = Path;
#[inline]
fn deref(&self) -> &Path { fn deref(&self) -> &Path {
Path::new(&self.inner) Path::new(&self.inner)
} }