1
Fork 0

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")]
impl ops::Deref for PathBuf {
type Target = Path;
#[inline]
fn deref(&self) -> &Path {
Path::new(&self.inner)
}