@@ -1361,6 +1361,7 @@ impl Url {
13611361 }
13621362
13631363 fn mutate < F : FnOnce ( & mut Parser < ' _ > ) -> R , R > ( & mut self , f : F ) -> R {
1364+ #[ allow( clippy:: mem_replace_with_default) ] // introduced in 1.40, MSRV is 1.36
13641365 let mut parser = Parser :: for_setter ( mem:: replace ( & mut self . serialization , String :: new ( ) ) ) ;
13651366 let result = f ( & mut parser) ;
13661367 self . serialization = parser. serialization ;
@@ -1551,19 +1552,19 @@ impl Url {
15511552 /// url.set_path("data/report.csv");
15521553 /// assert_eq!(url.as_str(), "https://example.com/data/report.csv");
15531554 /// assert_eq!(url.path(), "/data/report.csv");
1554- ///
1555+ ///
15551556 /// // `set_path` percent-encodes the given string if it's not already percent-encoded.
15561557 /// let mut url = Url::parse("https://example.com")?;
15571558 /// url.set_path("api/some comments");
15581559 /// assert_eq!(url.as_str(), "https://example.com/api/some%20comments");
15591560 /// assert_eq!(url.path(), "/api/some%20comments");
1560- ///
1561+ ///
15611562 /// // `set_path` will not double percent-encode the string if it's already percent-encoded.
15621563 /// let mut url = Url::parse("https://example.com")?;
15631564 /// url.set_path("api/some%20comments");
15641565 /// assert_eq!(url.as_str(), "https://example.com/api/some%20comments");
15651566 /// assert_eq!(url.path(), "/api/some%20comments");
1566- ///
1567+ ///
15671568 /// # Ok(())
15681569 /// # }
15691570 /// # run().unwrap();
@@ -2684,9 +2685,9 @@ fn path_to_file_url_segments(
26842685 path : & Path ,
26852686 serialization : & mut String ,
26862687) -> Result < ( u32 , HostInternal ) , ( ) > {
2687- #[ cfg( any( unix, target_os = "redox" ) ) ]
2688+ #[ cfg( any( unix, target_os = "redox" ) ) ]
26882689 use std:: os:: unix:: prelude:: OsStrExt ;
2689- #[ cfg( target_os = "wasi" ) ]
2690+ #[ cfg( target_os = "wasi" ) ]
26902691 use std:: os:: wasi:: prelude:: OsStrExt ;
26912692 if !path. is_absolute ( ) {
26922693 return Err ( ( ) ) ;
@@ -2783,9 +2784,9 @@ fn file_url_segments_to_pathbuf(
27832784 segments : str:: Split < ' _ , char > ,
27842785) -> Result < PathBuf , ( ) > {
27852786 use std:: ffi:: OsStr ;
2786- #[ cfg( any( unix, target_os = "redox" ) ) ]
2787+ #[ cfg( any( unix, target_os = "redox" ) ) ]
27872788 use std:: os:: unix:: prelude:: OsStrExt ;
2788- #[ cfg( target_os = "wasi" ) ]
2789+ #[ cfg( target_os = "wasi" ) ]
27892790 use std:: os:: wasi:: prelude:: OsStrExt ;
27902791
27912792 if host. is_some ( ) {
0 commit comments