Skip to content

Commit bb49bb3

Browse files
committed
Delete PathDisplay type
1 parent bd640d1 commit bb49bb3

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

src/display.rs

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use std::fmt::{self, Display};
2-
use std::path::{Path, PathBuf};
1+
use std::fmt::Display;
2+
use std::path::{self, Path, PathBuf};
33

44
#[doc(hidden)]
55
pub trait AsDisplay<'a> {
@@ -20,29 +20,19 @@ where
2020
}
2121

2222
impl<'a> AsDisplay<'a> for Path {
23-
type Target = PathDisplay<'a>;
23+
type Target = path::Display<'a>;
2424

2525
#[inline]
2626
fn as_display(&'a self) -> Self::Target {
27-
PathDisplay(self)
27+
self.display()
2828
}
2929
}
3030

3131
impl<'a> AsDisplay<'a> for PathBuf {
32-
type Target = PathDisplay<'a>;
32+
type Target = path::Display<'a>;
3333

3434
#[inline]
3535
fn as_display(&'a self) -> Self::Target {
36-
PathDisplay(self.as_path())
37-
}
38-
}
39-
40-
#[doc(hidden)]
41-
pub struct PathDisplay<'a>(&'a Path);
42-
43-
impl<'a> Display for PathDisplay<'a> {
44-
#[inline]
45-
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
46-
self.0.display().fmt(formatter)
36+
self.display()
4737
}
4838
}

0 commit comments

Comments
 (0)