1use std::fmt::Display;
2use std::path::{self, Path, PathBuf};
3
4#[doc(hidden)]
5pub trait DisplayAsDisplay {
6 fn as_display(&self) -> Self;
7}
8
9impl<T: Display> DisplayAsDisplay for &T {
10 fn as_display(&self) -> Self {
11 self
12 }
13}
14
15#[doc(hidden)]
16pub trait PathAsDisplay {
17 fn as_display(&self) -> path::Display<'_>;
18}
19
20impl PathAsDisplay for Path {
21 fn as_display(&self) -> path::Display<'_> {
22 self.display()
23 }
24}
25
26impl PathAsDisplay for PathBuf {
27 fn as_display(&self) -> path::Display<'_> {
28 self.display()
29 }
30}
31