@@ -1433,6 +1433,7 @@ impl Url {
14331433 /// Return an object with methods to manipulate this URL’s path segments.
14341434 ///
14351435 /// Return `Err(())` if this URL is cannot-be-a-base.
1436+ #[ allow( clippy:: clippy:: result_unit_err) ]
14361437 pub fn path_segments_mut ( & mut self ) -> Result < PathSegmentsMut < ' _ > , ( ) > {
14371438 if self . cannot_be_a_base ( ) {
14381439 Err ( ( ) )
@@ -1516,6 +1517,7 @@ impl Url {
15161517 /// # }
15171518 /// # run().unwrap();
15181519 /// ```
1520+ #[ allow( clippy:: clippy:: result_unit_err) ]
15191521 pub fn set_port ( & mut self , mut port : Option < u16 > ) -> Result < ( ) , ( ) > {
15201522 // has_host implies !cannot_be_a_base
15211523 if !self . has_host ( ) || self . host ( ) == Some ( Host :: Domain ( "" ) ) || self . scheme ( ) == "file" {
@@ -1655,7 +1657,7 @@ impl Url {
16551657 }
16561658
16571659 if let Some ( host) = host {
1658- if host == "" && SchemeType :: from ( self . scheme ( ) ) . is_special ( ) {
1660+ if host. is_empty ( ) && SchemeType :: from ( self . scheme ( ) ) . is_special ( ) {
16591661 return Err ( ParseError :: EmptyHost ) ;
16601662 }
16611663 let mut host_substr = host;
@@ -1786,6 +1788,7 @@ impl Url {
17861788 /// # run().unwrap();
17871789 /// ```
17881790 ///
1791+ #[ allow( clippy:: clippy:: result_unit_err) ]
17891792 pub fn set_ip_host ( & mut self , address : IpAddr ) -> Result < ( ) , ( ) > {
17901793 if self . cannot_be_a_base ( ) {
17911794 return Err ( ( ) ) ;
@@ -1825,6 +1828,7 @@ impl Url {
18251828 /// # }
18261829 /// # run().unwrap();
18271830 /// ```
1831+ #[ allow( clippy:: clippy:: result_unit_err) ]
18281832 pub fn set_password ( & mut self , password : Option < & str > ) -> Result < ( ) , ( ) > {
18291833 // has_host implies !cannot_be_a_base
18301834 if !self . has_host ( ) || self . host ( ) == Some ( Host :: Domain ( "" ) ) || self . scheme ( ) == "file" {
@@ -1917,6 +1921,7 @@ impl Url {
19171921 /// # }
19181922 /// # run().unwrap();
19191923 /// ```
1924+ #[ allow( clippy:: clippy:: result_unit_err) ]
19201925 pub fn set_username ( & mut self , username : & str ) -> Result < ( ) , ( ) > {
19211926 // has_host implies !cannot_be_a_base
19221927 if !self . has_host ( ) || self . host ( ) == Some ( Host :: Domain ( "" ) ) || self . scheme ( ) == "file" {
@@ -2078,6 +2083,7 @@ impl Url {
20782083 /// # }
20792084 /// # run().unwrap();
20802085 /// ```
2086+ #[ allow( clippy:: clippy:: result_unit_err) ]
20812087 pub fn set_scheme ( & mut self , scheme : & str ) -> Result < ( ) , ( ) > {
20822088 let mut parser = Parser :: for_setter ( String :: new ( ) ) ;
20832089 let remaining = parser. parse_scheme ( parser:: Input :: new ( scheme) ) ?;
@@ -2157,6 +2163,7 @@ impl Url {
21572163 /// # }
21582164 /// ```
21592165 #[ cfg( any( unix, windows, target_os = "redox" ) ) ]
2166+ #[ allow( clippy:: clippy:: result_unit_err) ]
21602167 pub fn from_file_path < P : AsRef < Path > > ( path : P ) -> Result < Url , ( ) > {
21612168 let mut serialization = "file://" . to_owned ( ) ;
21622169 let host_start = serialization. len ( ) as u32 ;
@@ -2193,6 +2200,7 @@ impl Url {
21932200 /// Note that `std::path` does not consider trailing slashes significant
21942201 /// and usually does not include them (e.g. in `Path::parent()`).
21952202 #[ cfg( any( unix, windows, target_os = "redox" ) ) ]
2203+ #[ allow( clippy:: clippy:: result_unit_err) ]
21962204 pub fn from_directory_path < P : AsRef < Path > > ( path : P ) -> Result < Url , ( ) > {
21972205 let mut url = Url :: from_file_path ( path) ?;
21982206 if !url. serialization . ends_with ( '/' ) {
@@ -2309,6 +2317,7 @@ impl Url {
23092317 /// for a Windows path, is not UTF-8.)
23102318 #[ inline]
23112319 #[ cfg( any( unix, windows, target_os = "redox" ) ) ]
2320+ #[ allow( clippy:: clippy:: result_unit_err) ]
23122321 pub fn to_file_path ( & self ) -> Result < PathBuf , ( ) > {
23132322 if let Some ( segments) = self . path_segments ( ) {
23142323 let host = match self . host ( ) {
0 commit comments