@@ -1361,6 +1361,7 @@ impl Url {
1361
1361
}
1362
1362
1363
1363
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
1364
1365
let mut parser = Parser :: for_setter ( mem:: replace ( & mut self . serialization , String :: new ( ) ) ) ;
1365
1366
let result = f ( & mut parser) ;
1366
1367
self . serialization = parser. serialization ;
@@ -1551,19 +1552,19 @@ impl Url {
1551
1552
/// url.set_path("data/report.csv");
1552
1553
/// assert_eq!(url.as_str(), "https://example.com/data/report.csv");
1553
1554
/// assert_eq!(url.path(), "/data/report.csv");
1554
- ///
1555
+ ///
1555
1556
/// // `set_path` percent-encodes the given string if it's not already percent-encoded.
1556
1557
/// let mut url = Url::parse("https://example.com")?;
1557
1558
/// url.set_path("api/some comments");
1558
1559
/// assert_eq!(url.as_str(), "https://example.com/api/some%20comments");
1559
1560
/// assert_eq!(url.path(), "/api/some%20comments");
1560
- ///
1561
+ ///
1561
1562
/// // `set_path` will not double percent-encode the string if it's already percent-encoded.
1562
1563
/// let mut url = Url::parse("https://example.com")?;
1563
1564
/// url.set_path("api/some%20comments");
1564
1565
/// assert_eq!(url.as_str(), "https://example.com/api/some%20comments");
1565
1566
/// assert_eq!(url.path(), "/api/some%20comments");
1566
- ///
1567
+ ///
1567
1568
/// # Ok(())
1568
1569
/// # }
1569
1570
/// # run().unwrap();
@@ -2684,9 +2685,9 @@ fn path_to_file_url_segments(
2684
2685
path : & Path ,
2685
2686
serialization : & mut String ,
2686
2687
) -> Result < ( u32 , HostInternal ) , ( ) > {
2687
- #[ cfg( any( unix, target_os = "redox" ) ) ]
2688
+ #[ cfg( any( unix, target_os = "redox" ) ) ]
2688
2689
use std:: os:: unix:: prelude:: OsStrExt ;
2689
- #[ cfg( target_os = "wasi" ) ]
2690
+ #[ cfg( target_os = "wasi" ) ]
2690
2691
use std:: os:: wasi:: prelude:: OsStrExt ;
2691
2692
if !path. is_absolute ( ) {
2692
2693
return Err ( ( ) ) ;
@@ -2783,9 +2784,9 @@ fn file_url_segments_to_pathbuf(
2783
2784
segments : str:: Split < ' _ , char > ,
2784
2785
) -> Result < PathBuf , ( ) > {
2785
2786
use std:: ffi:: OsStr ;
2786
- #[ cfg( any( unix, target_os = "redox" ) ) ]
2787
+ #[ cfg( any( unix, target_os = "redox" ) ) ]
2787
2788
use std:: os:: unix:: prelude:: OsStrExt ;
2788
- #[ cfg( target_os = "wasi" ) ]
2789
+ #[ cfg( target_os = "wasi" ) ]
2789
2790
use std:: os:: wasi:: prelude:: OsStrExt ;
2790
2791
2791
2792
if host. is_some ( ) {
0 commit comments