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 {
417417 /// # fn run() -> Result<(), ParseError> {
418418 /// let url_str = "https://example.net/";
419419 /// let url = Url::parse(url_str)?;
420- /// assert_eq!(url.into_string( ), url_str);
420+ /// assert_eq!(String::from(url ), url_str);
421421 /// # Ok(())
422422 /// # }
423423 /// # run().unwrap();
424424 /// ```
425425 #[ inline]
426+ #[ deprecated( since = "2.3.0" , note = "use Into<String>" ) ]
426427 pub fn into_string ( self ) -> String {
427- self . serialization
428+ self . into ( )
428429 }
429430
430431 /// For internal testing, not part of the public API.
@@ -2375,6 +2376,13 @@ impl fmt::Display for Url {
23752376 }
23762377}
23772378
2379+ /// String converstion.
2380+ impl From < Url > for String {
2381+ fn from ( value : Url ) -> String {
2382+ value. serialization
2383+ }
2384+ }
2385+
23782386/// Debug the serialization of this URL.
23792387impl fmt:: Debug for Url {
23802388 #[ inline]
You can’t perform that action at this time.
0 commit comments