@@ -185,21 +185,16 @@ use alloc::str;
185185use alloc:: string:: { String , ToString } ;
186186use alloc:: borrow:: ToOwned ;
187187#[ cfg( feature = "std" ) ]
188- use std:: path:: PathBuf ;
188+ use std:: path:: { Path , PathBuf } ;
189189use core:: convert:: TryFrom ;
190190
191191/// `std` version of `net`
192192#[ cfg( feature = "std" ) ]
193193pub ( crate ) mod net {
194194 pub use std:: net:: * ;
195195}
196- /// `no_std` non-nightly of `net`
197- #[ cfg( all( not( feature = "std" ) , feature = "no_std_net" ) ) ]
198- pub ( crate ) mod net {
199- pub use no_std_net:: * ;
200- }
201196/// `no_std` nightly version of `net`
202- #[ cfg( all ( not( feature = "std" ) , not ( feature = "no_std_net" ) ) ) ]
197+ #[ cfg( not( feature = "std" ) ) ]
203198pub ( crate ) mod net {
204199 pub use core:: net:: * ;
205200}
@@ -2717,7 +2712,7 @@ impl Url {
27172712 any( unix, windows, target_os = "redox" , target_os = "wasi" )
27182713 ) ) ]
27192714 #[ allow( clippy:: result_unit_err) ]
2720- pub fn to_file_path ( & self ) -> Result < std :: path :: PathBuf , ( ) > {
2715+ pub fn to_file_path ( & self ) -> Result < PathBuf , ( ) > {
27212716 if let Some ( segments) = self . path_segments ( ) {
27222717 let host = match self . host ( ) {
27232718 None | Some ( Host :: Domain ( "localhost" ) ) => None ,
@@ -2921,7 +2916,7 @@ impl<'de> serde::Deserialize<'de> for Url {
29212916
29222917#[ cfg( all( feature = "std" , any( unix, target_os = "redox" , target_os = "wasi" ) ) ) ]
29232918fn path_to_file_url_segments (
2924- path : & std :: path :: Path ,
2919+ path : & Path ,
29252920 serialization : & mut String ,
29262921) -> Result < ( u32 , HostInternal ) , ( ) > {
29272922 use parser:: SPECIAL_PATH_SEGMENT ;
@@ -2953,7 +2948,7 @@ fn path_to_file_url_segments(
29532948
29542949#[ cfg( all( feature = "std" , windows) ) ]
29552950fn path_to_file_url_segments (
2956- path : & std :: path :: Path ,
2951+ path : & Path ,
29572952 serialization : & mut String ,
29582953) -> Result < ( u32 , HostInternal ) , ( ) > {
29592954 path_to_file_url_segments_windows ( path, serialization)
@@ -2964,7 +2959,7 @@ fn path_to_file_url_segments(
29642959#[ cfg_attr( not( windows) , allow( dead_code) ) ]
29652960#[ cfg( feature = "std" ) ]
29662961fn path_to_file_url_segments_windows (
2967- path : & std :: path :: Path ,
2962+ path : & Path ,
29682963 serialization : & mut String ,
29692964) -> Result < ( u32 , HostInternal ) , ( ) > {
29702965 use crate :: parser:: PATH_SEGMENT ;
@@ -3079,14 +3074,13 @@ fn file_url_segments_to_pathbuf(
30793074fn file_url_segments_to_pathbuf (
30803075 host : Option < & str > ,
30813076 segments : str:: Split < char > ,
3082- ) -> Result < std :: path :: PathBuf , ( ) > {
3077+ ) -> Result < PathBuf , ( ) > {
30833078 file_url_segments_to_pathbuf_windows ( host, segments)
30843079}
30853080
3086- #[ cfg( feature = "std" ) ]
30873081// Build this unconditionally to alleviate https://github.com/servo/rust-url/issues/102
3088- #[ cfg_attr( not( windows) , allow( dead_code) ) ]
30893082#[ cfg( feature = "std" ) ]
3083+ #[ cfg_attr( not( windows) , allow( dead_code) ) ]
30903084fn file_url_segments_to_pathbuf_windows (
30913085 host : Option < & str > ,
30923086 mut segments : str:: Split < ' _ , char > ,
@@ -3131,7 +3125,7 @@ fn file_url_segments_to_pathbuf_windows(
31313125 Err ( ..) => return Err ( ( ) ) ,
31323126 }
31333127 }
3134- let path = std :: path :: PathBuf :: from ( string) ;
3128+ let path = PathBuf :: from ( string) ;
31353129 debug_assert ! (
31363130 path. is_absolute( ) ,
31373131 "to_file_path() failed to produce an absolute Path"
0 commit comments