@@ -3,6 +3,7 @@ use std::{
33 borrow:: { Borrow , Cow } ,
44 cmp,
55 collections:: TryReserveError ,
6+ fmt,
67 hash:: { Hash , Hasher } ,
78 iter:: { Extend , FromIterator } ,
89 marker:: PhantomData ,
@@ -57,7 +58,6 @@ use std::{
5758/// ```
5859///
5960/// Which method works best depends on what kind of situation you're in.
60- #[ derive( Clone , Debug ) ]
6161pub struct PathBuf < T >
6262where
6363 T : for < ' enc > Encoding < ' enc > ,
@@ -388,6 +388,31 @@ where
388388 }
389389}
390390
391+ impl < T > Clone for PathBuf < T >
392+ where
393+ T : for < ' enc > Encoding < ' enc > ,
394+ {
395+ #[ inline]
396+ fn clone ( & self ) -> Self {
397+ Self {
398+ _encoding : self . _encoding ,
399+ inner : self . inner . clone ( ) ,
400+ }
401+ }
402+ }
403+
404+ impl < T > fmt:: Debug for PathBuf < T >
405+ where
406+ T : for < ' enc > Encoding < ' enc > ,
407+ {
408+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
409+ f. debug_struct ( "PathBuf" )
410+ . field ( "_encoding" , & T :: label ( ) )
411+ . field ( "inner" , & self . inner )
412+ . finish ( )
413+ }
414+ }
415+
391416impl < T > AsRef < [ u8 ] > for PathBuf < T >
392417where
393418 T : for < ' enc > Encoding < ' enc > ,
0 commit comments