@@ -23,7 +23,7 @@ use std::{error, fmt, iter, mem};
2323use tokio:: io:: { AsyncRead , AsyncWrite } ;
2424
2525/// Properties required of a session.
26- #[ derive( Debug , Copy , Clone , PartialEq ) ]
26+ #[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
2727#[ non_exhaustive]
2828pub enum TargetSessionAttrs {
2929 /// No special properties are required.
@@ -33,7 +33,7 @@ pub enum TargetSessionAttrs {
3333}
3434
3535/// TLS configuration.
36- #[ derive( Debug , Copy , Clone , PartialEq ) ]
36+ #[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
3737#[ non_exhaustive]
3838pub enum SslMode {
3939 /// Do not use TLS.
@@ -45,7 +45,7 @@ pub enum SslMode {
4545}
4646
4747/// Channel binding configuration.
48- #[ derive( Debug , Copy , Clone , PartialEq ) ]
48+ #[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
4949#[ non_exhaustive]
5050pub enum ChannelBinding {
5151 /// Do not use channel binding.
@@ -57,7 +57,7 @@ pub enum ChannelBinding {
5757}
5858
5959/// A host specification.
60- #[ derive( Debug , Clone , PartialEq ) ]
60+ #[ derive( Debug , Clone , PartialEq , Eq ) ]
6161pub enum Host {
6262 /// A TCP hostname.
6363 Tcp ( String ) ,
@@ -144,7 +144,7 @@ pub enum Host {
144144/// ```not_rust
145145/// postgresql:///mydb?user=user&host=/var/lib/postgresql
146146/// ```
147- #[ derive( PartialEq , Clone ) ]
147+ #[ derive( Clone , PartialEq , Eq ) ]
148148pub struct Config {
149149 pub ( crate ) user : Option < String > ,
150150 pub ( crate ) password : Option < Vec < u8 > > ,
@@ -452,7 +452,7 @@ impl Config {
452452 }
453453 }
454454 "target_session_attrs" => {
455- let target_session_attrs = match & * value {
455+ let target_session_attrs = match value {
456456 "any" => TargetSessionAttrs :: Any ,
457457 "read-write" => TargetSessionAttrs :: ReadWrite ,
458458 _ => {
@@ -900,7 +900,7 @@ impl<'a> UrlParser<'a> {
900900 #[ cfg( unix) ]
901901 fn host_param ( & mut self , s : & str ) -> Result < ( ) , Error > {
902902 let decoded = Cow :: from ( percent_encoding:: percent_decode ( s. as_bytes ( ) ) ) ;
903- if decoded. get ( 0 ) == Some ( & b'/' ) {
903+ if decoded. first ( ) == Some ( & b'/' ) {
904904 self . config . host_path ( OsStr :: from_bytes ( & decoded) ) ;
905905 } else {
906906 let decoded = str:: from_utf8 ( & decoded) . map_err ( |e| Error :: config_parse ( Box :: new ( e) ) ) ?;
0 commit comments