Skip to content

Commit 8e83a97

Browse files
committed
Switch to new destructure wildcard format
1 parent 99d570f commit 8e83a97

4 files changed

Lines changed: 20 additions & 20 deletions

File tree

lib.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ pub struct PostgresCancelData {
207207
/// that connection.
208208
pub fn cancel_query(url: &str, ssl: &SslMode, data: PostgresCancelData)
209209
-> Option<PostgresConnectError> {
210-
let Url { host, port, _ }: Url = match FromStr::from_str(url) {
210+
let Url { host, port, .. }: Url = match FromStr::from_str(url) {
211211
Some(url) => url,
212212
None => return Some(InvalidUrl)
213213
};
@@ -339,7 +339,7 @@ impl InnerPostgresConnection {
339339
user,
340340
path,
341341
query: args,
342-
_
342+
..
343343
}: Url = match FromStr::from_str(url) {
344344
Some(url) => url,
345345
None => return Err(InvalidUrl)
@@ -394,7 +394,7 @@ impl InnerPostgresConnection {
394394
conn.cancel_data.process_id = process_id;
395395
conn.cancel_data.secret_key = secret_key;
396396
}
397-
ReadyForQuery { _ } => break,
397+
ReadyForQuery { .. } => break,
398398
ErrorResponse { fields } =>
399399
return Err(DbError(PostgresDbError::new(fields))),
400400
_ => unreachable!()
@@ -539,7 +539,7 @@ impl InnerPostgresConnection {
539539

540540
fn wait_for_ready(&mut self) {
541541
match self.read_message() {
542-
ReadyForQuery { _ } => {}
542+
ReadyForQuery { .. } => {}
543543
_ => unreachable!()
544544
}
545545
}
@@ -679,7 +679,7 @@ impl PostgresConnection {
679679

680680
loop {
681681
match conn.read_message() {
682-
ReadyForQuery { _ } => break,
682+
ReadyForQuery { .. } => break,
683683
ErrorResponse { fields } =>
684684
fail!("Error: {}",
685685
PostgresDbError::new(fields).to_str()),
@@ -876,7 +876,7 @@ impl<'conn> Drop for NormalPostgresStatement<'conn> {
876876
Sync]);
877877
loop {
878878
match self.conn.read_message() {
879-
ReadyForQuery { _ } => break,
879+
ReadyForQuery { .. } => break,
880880
_ => {}
881881
}
882882
}
@@ -972,7 +972,7 @@ impl<'conn> PostgresStatement for NormalPostgresStatement<'conn> {
972972
let num;
973973
loop {
974974
match self.conn.read_message() {
975-
DataRow { _ } => {}
975+
DataRow { .. } => {}
976976
ErrorResponse { fields } => {
977977
self.conn.wait_for_ready();
978978
return Err(PostgresDbError::new(fields));
@@ -1015,7 +1015,7 @@ pub struct ResultDescription {
10151015
impl ResultDescription {
10161016
fn from_row_description_entry(row: RowDescriptionEntry)
10171017
-> ResultDescription {
1018-
let RowDescriptionEntry { name, type_oid, _ } = row;
1018+
let RowDescriptionEntry { name, type_oid, .. } = row;
10191019

10201020
ResultDescription {
10211021
name: name,
@@ -1102,7 +1102,7 @@ impl<'stmt> Drop for PostgresResult<'stmt> {
11021102
Sync]);
11031103
loop {
11041104
match self.stmt.conn.read_message() {
1105-
ReadyForQuery { _ } => break,
1105+
ReadyForQuery { .. } => break,
11061106
_ => {}
11071107
}
11081108
}
@@ -1115,7 +1115,7 @@ impl<'stmt> PostgresResult<'stmt> {
11151115
loop {
11161116
match self.stmt.conn.read_message() {
11171117
EmptyQueryResponse |
1118-
CommandComplete { _ } => {
1118+
CommandComplete { .. } => {
11191119
self.more_rows = false;
11201120
break;
11211121
},

test.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ fn test_url_terminating_slash() {
7979
fn test_prepare_err() {
8080
let conn = PostgresConnection::connect("postgres://postgres@localhost", &NoSsl);
8181
match conn.try_prepare("invalid sql statment") {
82-
Err(PostgresDbError { code: SyntaxError, position: Some(Position(1)), _ }) => (),
82+
Err(PostgresDbError { code: SyntaxError, position: Some(Position(1)), .. }) => (),
8383
resp => fail!("Unexpected result {:?}", resp)
8484
}
8585
}
8686

8787
#[test]
8888
fn test_unknown_database() {
8989
match PostgresConnection::try_connect("postgres://postgres@localhost/asdf", &NoSsl) {
90-
Err(DbError(PostgresDbError { code: InvalidCatalogName, _ })) => {}
90+
Err(DbError(PostgresDbError { code: InvalidCatalogName, .. })) => {}
9191
resp => fail!("Unexpected result {:?}", resp)
9292
}
9393
}
@@ -520,7 +520,7 @@ fn test_notification_iterator_some() {
520520
fn check_notification(expected: PostgresNotification,
521521
actual: Option<PostgresNotification>) {
522522
match actual {
523-
Some(PostgresNotification { channel, payload, _ }) => {
523+
Some(PostgresNotification { channel, payload, .. }) => {
524524
assert_eq!(&expected.channel, &channel);
525525
assert_eq!(&expected.payload, &payload);
526526
}
@@ -569,7 +569,7 @@ fn test_cancel_query() {
569569
}
570570

571571
match conn.try_update("SELECT pg_sleep(10)", []) {
572-
Err(PostgresDbError { code: QueryCanceled, _ }) => {}
572+
Err(PostgresDbError { code: QueryCanceled, .. }) => {}
573573
res => fail!("Unexpected result {:?}", res)
574574
}
575575
}
@@ -609,7 +609,7 @@ fn test_plaintext_pass_no_pass() {
609609
fn test_plaintext_pass_wrong_pass() {
610610
let ret = PostgresConnection::try_connect("postgres://pass_user:asdf@localhost/postgres", &NoSsl);
611611
match ret {
612-
Err(DbError(PostgresDbError { code: InvalidPassword, _ })) => (),
612+
Err(DbError(PostgresDbError { code: InvalidPassword, .. })) => (),
613613
Err(err) => fail!("Unexpected error {}", err.to_str()),
614614
_ => fail!("Expected error")
615615
}
@@ -634,7 +634,7 @@ fn test_md5_pass_no_pass() {
634634
fn test_md5_pass_wrong_pass() {
635635
let ret = PostgresConnection::try_connect("postgres://md5_user:asdf@localhost/postgres", &NoSsl);
636636
match ret {
637-
Err(DbError(PostgresDbError { code: InvalidPassword, _ })) => (),
637+
Err(DbError(PostgresDbError { code: InvalidPassword, .. })) => (),
638638
Err(err) => fail!("Unexpected error {}", err.to_str()),
639639
_ => fail!("Expected error")
640640
}

types/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ impl PostgresType {
125125
/// Returns the wire format needed for the value of `self`.
126126
pub fn result_format(&self) -> Format {
127127
match *self {
128-
PgUnknownType(*) => Text,
128+
PgUnknownType(..) => Text,
129129
_ => Binary
130130
}
131131
}
@@ -504,13 +504,13 @@ macro_rules! to_range_impl(
504504
} else {
505505
match self.lower() {
506506
&None => tag |= RANGE_LOWER_UNBOUNDED,
507-
&Some(RangeBound { type_: Inclusive, _ }) =>
507+
&Some(RangeBound { type_: Inclusive, .. }) =>
508508
tag |= RANGE_LOWER_INCLUSIVE,
509509
_ => {}
510510
}
511511
match self.upper() {
512512
&None => tag |= RANGE_UPPER_UNBOUNDED,
513-
&Some(RangeBound { type_: Inclusive, _ }) =>
513+
&Some(RangeBound { type_: Inclusive, .. }) =>
514514
tag |= RANGE_UPPER_INCLUSIVE,
515515
_ => {}
516516
}

types/range.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ impl<T: Ord+Normalizable> Range<T> {
184184
pub fn is_empty(&self) -> bool {
185185
match *self {
186186
Empty => true,
187-
Normal(*) => false
187+
Normal(..) => false
188188
}
189189
}
190190

0 commit comments

Comments
 (0)