@@ -23,7 +23,7 @@ use std::{error, fmt, iter, mem};
23
23
use tokio:: io:: { AsyncRead , AsyncWrite } ;
24
24
25
25
/// Properties required of a session.
26
- #[ derive( Debug , Copy , Clone , PartialEq ) ]
26
+ #[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
27
27
#[ non_exhaustive]
28
28
pub enum TargetSessionAttrs {
29
29
/// No special properties are required.
@@ -33,7 +33,7 @@ pub enum TargetSessionAttrs {
33
33
}
34
34
35
35
/// TLS configuration.
36
- #[ derive( Debug , Copy , Clone , PartialEq ) ]
36
+ #[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
37
37
#[ non_exhaustive]
38
38
pub enum SslMode {
39
39
/// Do not use TLS.
@@ -45,7 +45,7 @@ pub enum SslMode {
45
45
}
46
46
47
47
/// Channel binding configuration.
48
- #[ derive( Debug , Copy , Clone , PartialEq ) ]
48
+ #[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
49
49
#[ non_exhaustive]
50
50
pub enum ChannelBinding {
51
51
/// Do not use channel binding.
@@ -57,7 +57,7 @@ pub enum ChannelBinding {
57
57
}
58
58
59
59
/// A host specification.
60
- #[ derive( Debug , Clone , PartialEq ) ]
60
+ #[ derive( Debug , Clone , PartialEq , Eq ) ]
61
61
pub enum Host {
62
62
/// A TCP hostname.
63
63
Tcp ( String ) ,
@@ -144,7 +144,7 @@ pub enum Host {
144
144
/// ```not_rust
145
145
/// postgresql:///mydb?user=user&host=/var/lib/postgresql
146
146
/// ```
147
- #[ derive( PartialEq , Clone ) ]
147
+ #[ derive( Clone , PartialEq , Eq ) ]
148
148
pub struct Config {
149
149
pub ( crate ) user : Option < String > ,
150
150
pub ( crate ) password : Option < Vec < u8 > > ,
@@ -452,7 +452,7 @@ impl Config {
452
452
}
453
453
}
454
454
"target_session_attrs" => {
455
- let target_session_attrs = match & * value {
455
+ let target_session_attrs = match value {
456
456
"any" => TargetSessionAttrs :: Any ,
457
457
"read-write" => TargetSessionAttrs :: ReadWrite ,
458
458
_ => {
@@ -900,7 +900,7 @@ impl<'a> UrlParser<'a> {
900
900
#[ cfg( unix) ]
901
901
fn host_param ( & mut self , s : & str ) -> Result < ( ) , Error > {
902
902
let decoded = Cow :: from ( percent_encoding:: percent_decode ( s. as_bytes ( ) ) ) ;
903
- if decoded. get ( 0 ) == Some ( & b'/' ) {
903
+ if decoded. first ( ) == Some ( & b'/' ) {
904
904
self . config . host_path ( OsStr :: from_bytes ( & decoded) ) ;
905
905
} else {
906
906
let decoded = str:: from_utf8 ( & decoded) . map_err ( |e| Error :: config_parse ( Box :: new ( e) ) ) ?;
0 commit comments