File tree Expand file tree Collapse file tree 4 files changed +32
-0
lines changed
Expand file tree Collapse file tree 4 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,14 @@ impl TryFrom<String> for NormalizedPathAbsolute {
5858 }
5959}
6060
61+ impl TryFrom < Utf8PathBuf > for NormalizedPathAbsolute {
62+ type Error = NormalizeError ;
63+
64+ fn try_from ( p : Utf8PathBuf ) -> Result < Self , Self :: Error > {
65+ Self :: from_str ( p. as_ref ( ) )
66+ }
67+ }
68+
6169impl From < NormalizedPathAbsolute > for String {
6270 fn from ( p : NormalizedPathAbsolute ) -> Self {
6371 p. to_string ( )
Original file line number Diff line number Diff line change @@ -65,6 +65,14 @@ impl TryFrom<String> for NormalizedPathComponent {
6565 }
6666}
6767
68+ impl TryFrom < Utf8PathBuf > for NormalizedPathComponent {
69+ type Error = NormalizeError ;
70+
71+ fn try_from ( p : Utf8PathBuf ) -> Result < Self , Self :: Error > {
72+ Self :: from_str ( p. as_ref ( ) )
73+ }
74+ }
75+
6876impl From < NormalizedPathComponent > for String {
6977 fn from ( p : NormalizedPathComponent ) -> Self {
7078 p. to_string ( )
Original file line number Diff line number Diff line change @@ -137,6 +137,14 @@ impl TryFrom<String> for NormalizedPath {
137137 }
138138}
139139
140+ impl TryFrom < Utf8PathBuf > for NormalizedPath {
141+ type Error = NormalizeError ;
142+
143+ fn try_from ( p : Utf8PathBuf ) -> Result < Self , Self :: Error > {
144+ Self :: from_str ( p. as_ref ( ) )
145+ }
146+ }
147+
140148impl From < NormalizedPath > for String {
141149 fn from ( p : NormalizedPath ) -> Self {
142150 p. to_string ( )
Original file line number Diff line number Diff line change @@ -58,6 +58,14 @@ impl TryFrom<String> for NormalizedPathRelative {
5858 }
5959}
6060
61+ impl TryFrom < Utf8PathBuf > for NormalizedPathRelative {
62+ type Error = NormalizeError ;
63+
64+ fn try_from ( p : Utf8PathBuf ) -> Result < Self , Self :: Error > {
65+ Self :: from_str ( p. as_ref ( ) )
66+ }
67+ }
68+
6169impl From < NormalizedPathRelative > for String {
6270 fn from ( p : NormalizedPathRelative ) -> Self {
6371 p. to_string ( )
You can’t perform that action at this time.
0 commit comments