File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -417,14 +417,15 @@ impl Url {
417
417
/// # fn run() -> Result<(), ParseError> {
418
418
/// let url_str = "https://example.net/";
419
419
/// let url = Url::parse(url_str)?;
420
- /// assert_eq!(url.into_string( ), url_str);
420
+ /// assert_eq!(String::from(url ), url_str);
421
421
/// # Ok(())
422
422
/// # }
423
423
/// # run().unwrap();
424
424
/// ```
425
425
#[ inline]
426
+ #[ deprecated( since = "2.3.0" , note = "use Into<String>" ) ]
426
427
pub fn into_string ( self ) -> String {
427
- self . serialization
428
+ self . into ( )
428
429
}
429
430
430
431
/// For internal testing, not part of the public API.
@@ -2375,6 +2376,13 @@ impl fmt::Display for Url {
2375
2376
}
2376
2377
}
2377
2378
2379
+ /// String converstion.
2380
+ impl From < Url > for String {
2381
+ fn from ( value : Url ) -> String {
2382
+ value. serialization
2383
+ }
2384
+ }
2385
+
2378
2386
/// Debug the serialization of this URL.
2379
2387
impl fmt:: Debug for Url {
2380
2388
#[ inline]
You can’t perform that action at this time.
0 commit comments