@@ -58,18 +58,23 @@ extern crate std;
5858use std:: string:: String ;
5959
6060use core:: { borrow, ffi:: c_uint, fmt, hash, ops} ;
61- use derive_more:: Display ;
6261
6362/// Error type of [`Url::parse`].
64- #[ derive( Debug , Display , PartialEq , Eq ) ]
65- #[ cfg_attr( feature = "std" , derive( derive_more:: Error ) ) ] // error still requires std: https://github.com/rust-lang/rust/issues/103765
66- #[ display( bound( Input : core:: fmt:: Debug ) ) ]
67- #[ display( "Invalid url: {input:?}" ) ]
63+ #[ derive( Debug , PartialEq , Eq ) ]
6864pub struct ParseUrlError < Input > {
6965 /// The invalid input that caused the error.
7066 pub input : Input ,
7167}
7268
69+ impl < Input : core:: fmt:: Debug > fmt:: Display for ParseUrlError < Input > {
70+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
71+ write ! ( f, "Invalid url: {:?}" , self . input)
72+ }
73+ }
74+
75+ #[ cfg( feature = "std" ) ] // error still requires std: https://github.com/rust-lang/rust/issues/103765
76+ impl < Input : core:: fmt:: Debug > std:: error:: Error for ParseUrlError < Input > { }
77+
7378/// Defines the type of the host.
7479#[ derive( Debug , Clone , PartialEq , Eq ) ]
7580pub enum HostType {
0 commit comments