@@ -179,18 +179,14 @@ impl From<*mut ffi::ada_url> for Url {
179179 }
180180}
181181
182- #[ derive( Debug , Clone , PartialEq , Eq , PartialOrd , Ord , Hash , Default , Display ) ]
183- #[ cfg_attr( feature = "std" , derive( derive_more:: Error ) ) ] // error still requires std: https://github.com/rust-lang/rust/issues/103765
184- pub struct SetterError ;
185-
186- type SetterResult = Result < ( ) , SetterError > ;
182+ type SetterResult = Result < ( ) , ( ) > ;
187183
188184#[ inline]
189185const fn setter_result ( successful : bool ) -> SetterResult {
190186 if successful {
191187 Ok ( ( ) )
192188 } else {
193- Err ( SetterError )
189+ Err ( ( ) )
194190 }
195191}
196192
@@ -299,6 +295,7 @@ impl Url {
299295 /// url.set_href("https://lemire.me").unwrap();
300296 /// assert_eq!(url.href(), "https://lemire.me/");
301297 /// ```
298+ #[ allow( clippy:: result_unit_err) ]
302299 pub fn set_href ( & mut self , input : & str ) -> SetterResult {
303300 setter_result ( unsafe { ffi:: ada_set_href ( self . 0 , input. as_ptr ( ) . cast ( ) , input. len ( ) ) } )
304301 }
@@ -327,6 +324,7 @@ impl Url {
327324 /// url.set_username(Some("username")).unwrap();
328325 /// assert_eq!(url.href(), "https://username@yagiz.co/");
329326 /// ```
327+ #[ allow( clippy:: result_unit_err) ]
330328 pub fn set_username ( & mut self , input : Option < & str > ) -> SetterResult {
331329 setter_result ( unsafe {
332330 ffi:: ada_set_username (
@@ -361,6 +359,7 @@ impl Url {
361359 /// url.set_password(Some("password")).unwrap();
362360 /// assert_eq!(url.href(), "https://:password@yagiz.co/");
363361 /// ```
362+ #[ allow( clippy:: result_unit_err) ]
364363 pub fn set_password ( & mut self , input : Option < & str > ) -> SetterResult {
365364 setter_result ( unsafe {
366365 ffi:: ada_set_password (
@@ -398,6 +397,7 @@ impl Url {
398397 /// url.set_port(Some("8080")).unwrap();
399398 /// assert_eq!(url.href(), "https://yagiz.co:8080/");
400399 /// ```
400+ #[ allow( clippy:: result_unit_err) ]
401401 pub fn set_port ( & mut self , input : Option < & str > ) -> SetterResult {
402402 if let Some ( value) = input {
403403 setter_result ( unsafe { ffi:: ada_set_port ( self . 0 , value. as_ptr ( ) . cast ( ) , value. len ( ) ) } )
@@ -469,6 +469,7 @@ impl Url {
469469 /// url.set_host(Some("localhost:3000")).unwrap();
470470 /// assert_eq!(url.href(), "https://localhost:3000/");
471471 /// ```
472+ #[ allow( clippy:: result_unit_err) ]
472473 pub fn set_host ( & mut self , input : Option < & str > ) -> SetterResult {
473474 setter_result ( unsafe {
474475 ffi:: ada_set_host (
@@ -507,6 +508,7 @@ impl Url {
507508 /// url.set_hostname(Some("localhost")).unwrap();
508509 /// assert_eq!(url.href(), "https://localhost/");
509510 /// ```
511+ #[ allow( clippy:: result_unit_err) ]
510512 pub fn set_hostname ( & mut self , input : Option < & str > ) -> SetterResult {
511513 setter_result ( unsafe {
512514 ffi:: ada_set_hostname (
@@ -541,6 +543,7 @@ impl Url {
541543 /// url.set_pathname(Some("/contact")).unwrap();
542544 /// assert_eq!(url.href(), "https://yagiz.co/contact");
543545 /// ```
546+ #[ allow( clippy:: result_unit_err) ]
544547 pub fn set_pathname ( & mut self , input : Option < & str > ) -> SetterResult {
545548 setter_result ( unsafe {
546549 ffi:: ada_set_pathname (
@@ -611,6 +614,7 @@ impl Url {
611614 /// url.set_protocol("http").unwrap();
612615 /// assert_eq!(url.href(), "http://yagiz.co/");
613616 /// ```
617+ #[ allow( clippy:: result_unit_err) ]
614618 pub fn set_protocol ( & mut self , input : & str ) -> SetterResult {
615619 setter_result ( unsafe { ffi:: ada_set_protocol ( self . 0 , input. as_ptr ( ) . cast ( ) , input. len ( ) ) } )
616620 }
0 commit comments