Skip to content

Commit fd53c56

Browse files
committed
Clean up syntax
1 parent 594606a commit fd53c56

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

postgres/tests/test.rs

+23-23
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ fn test_transaction_commit() {
113113
"postgres://postgres@localhost:5433",
114114
TlsMode::None,
115115
));
116-
or_panic!(conn.execute("CREATE TEMPORARY TABLE foo (id INT PRIMARY KEY)", &[],));
116+
or_panic!(conn.execute("CREATE TEMPORARY TABLE foo (id INT PRIMARY KEY)", &[]));
117117

118118
let trans = or_panic!(conn.transaction());
119119
or_panic!(trans.execute("INSERT INTO foo (id) VALUES ($1)", &[&1i32]));
@@ -135,7 +135,7 @@ fn test_transaction_commit_finish() {
135135
"postgres://postgres@localhost:5433",
136136
TlsMode::None,
137137
));
138-
or_panic!(conn.execute("CREATE TEMPORARY TABLE foo (id INT PRIMARY KEY)", &[],));
138+
or_panic!(conn.execute("CREATE TEMPORARY TABLE foo (id INT PRIMARY KEY)", &[]));
139139

140140
let trans = or_panic!(conn.transaction());
141141
or_panic!(trans.execute("INSERT INTO foo (id) VALUES ($1)", &[&1i32]));
@@ -157,7 +157,7 @@ fn test_transaction_commit_method() {
157157
"postgres://postgres@localhost:5433",
158158
TlsMode::None,
159159
));
160-
or_panic!(conn.execute("CREATE TEMPORARY TABLE foo (id INT PRIMARY KEY)", &[],));
160+
or_panic!(conn.execute("CREATE TEMPORARY TABLE foo (id INT PRIMARY KEY)", &[]));
161161

162162
let trans = or_panic!(conn.transaction());
163163
or_panic!(trans.execute("INSERT INTO foo (id) VALUES ($1)", &[&1i32]));
@@ -178,7 +178,7 @@ fn test_transaction_rollback() {
178178
"postgres://postgres@localhost:5433",
179179
TlsMode::None,
180180
));
181-
or_panic!(conn.execute("CREATE TEMPORARY TABLE foo (id INT PRIMARY KEY)", &[],));
181+
or_panic!(conn.execute("CREATE TEMPORARY TABLE foo (id INT PRIMARY KEY)", &[]));
182182

183183
or_panic!(conn.execute("INSERT INTO foo (id) VALUES ($1)", &[&1i32]));
184184

@@ -201,7 +201,7 @@ fn test_transaction_rollback_finish() {
201201
"postgres://postgres@localhost:5433",
202202
TlsMode::None,
203203
));
204-
or_panic!(conn.execute("CREATE TEMPORARY TABLE foo (id INT PRIMARY KEY)", &[],));
204+
or_panic!(conn.execute("CREATE TEMPORARY TABLE foo (id INT PRIMARY KEY)", &[]));
205205

206206
or_panic!(conn.execute("INSERT INTO foo (id) VALUES ($1)", &[&1i32]));
207207

@@ -224,7 +224,7 @@ fn test_nested_transactions() {
224224
"postgres://postgres@localhost:5433",
225225
TlsMode::None,
226226
));
227-
or_panic!(conn.execute("CREATE TEMPORARY TABLE foo (id INT PRIMARY KEY)", &[],));
227+
or_panic!(conn.execute("CREATE TEMPORARY TABLE foo (id INT PRIMARY KEY)", &[]));
228228

229229
or_panic!(conn.execute("INSERT INTO foo (id) VALUES (1)", &[]));
230230

@@ -279,7 +279,7 @@ fn test_nested_transactions_finish() {
279279
"postgres://postgres@localhost:5433",
280280
TlsMode::None,
281281
));
282-
or_panic!(conn.execute("CREATE TEMPORARY TABLE foo (id INT PRIMARY KEY)", &[],));
282+
or_panic!(conn.execute("CREATE TEMPORARY TABLE foo (id INT PRIMARY KEY)", &[]));
283283

284284
or_panic!(conn.execute("INSERT INTO foo (id) VALUES (1)", &[]));
285285

@@ -391,7 +391,7 @@ fn test_stmt_finish() {
391391
"postgres://postgres@localhost:5433",
392392
TlsMode::None,
393393
));
394-
or_panic!(conn.execute("CREATE TEMPORARY TABLE foo (id BIGINT PRIMARY KEY)", &[],));
394+
or_panic!(conn.execute("CREATE TEMPORARY TABLE foo (id BIGINT PRIMARY KEY)", &[]));
395395
let stmt = or_panic!(conn.prepare("SELECT * FROM foo"));
396396
assert!(stmt.finish().is_ok());
397397
}
@@ -461,8 +461,8 @@ fn test_query() {
461461
"postgres://postgres@localhost:5433",
462462
TlsMode::None,
463463
));
464-
or_panic!(conn.execute("CREATE TEMPORARY TABLE foo (id BIGINT PRIMARY KEY)", &[],));
465-
or_panic!(conn.execute("INSERT INTO foo (id) VALUES ($1), ($2)", &[&1i64, &2i64],));
464+
or_panic!(conn.execute("CREATE TEMPORARY TABLE foo (id BIGINT PRIMARY KEY)", &[]));
465+
or_panic!(conn.execute("INSERT INTO foo (id) VALUES ($1), ($2)", &[&1i64, &2i64]));
466466
let stmt = or_panic!(conn.prepare("SELECT * from foo ORDER BY id"));
467467
let result = or_panic!(stmt.query(&[]));
468468

@@ -502,7 +502,7 @@ fn test_lazy_query() {
502502
));
503503

504504
let trans = or_panic!(conn.transaction());
505-
or_panic!(trans.execute("CREATE TEMPORARY TABLE foo (id INT PRIMARY KEY)", &[],));
505+
or_panic!(trans.execute("CREATE TEMPORARY TABLE foo (id INT PRIMARY KEY)", &[]));
506506
let stmt = or_panic!(trans.prepare("INSERT INTO foo (id) VALUES ($1)"));
507507
let values = vec![0i32, 1, 2, 3, 4, 5];
508508
for value in &values {
@@ -751,8 +751,8 @@ fn test_notification_iterator_some() {
751751
));
752752
let notifications = conn.notifications();
753753
let mut it = notifications.iter();
754-
or_panic!(conn.execute("LISTEN test_notification_iterator_one_channel", &[],));
755-
or_panic!(conn.execute("LISTEN test_notification_iterator_one_channel2", &[],));
754+
or_panic!(conn.execute("LISTEN test_notification_iterator_one_channel", &[]));
755+
or_panic!(conn.execute("LISTEN test_notification_iterator_one_channel2", &[]));
756756
or_panic!(conn.execute(
757757
"NOTIFY test_notification_iterator_one_channel, 'hello'",
758758
&[],
@@ -780,7 +780,7 @@ fn test_notification_iterator_some() {
780780
);
781781
assert!(it.next().unwrap().is_none());
782782

783-
or_panic!(conn.execute("NOTIFY test_notification_iterator_one_channel, '!'", &[],));
783+
or_panic!(conn.execute("NOTIFY test_notification_iterator_one_channel, '!'", &[]));
784784
check_notification(
785785
Notification {
786786
process_id: 0,
@@ -806,7 +806,7 @@ fn test_notifications_next_block() {
806806
TlsMode::None,
807807
));
808808
thread::sleep(Duration::from_millis(500));
809-
or_panic!(conn.execute("NOTIFY test_notifications_next_block, 'foo'", &[],));
809+
or_panic!(conn.execute("NOTIFY test_notifications_next_block, 'foo'", &[]));
810810
});
811811

812812
let notifications = conn.notifications();
@@ -834,9 +834,9 @@ fn test_notification_next_timeout() {
834834
TlsMode::None,
835835
));
836836
thread::sleep(Duration::from_millis(500));
837-
or_panic!(conn.execute("NOTIFY test_notifications_next_timeout, 'foo'", &[],));
837+
or_panic!(conn.execute("NOTIFY test_notifications_next_timeout, 'foo'", &[]));
838838
thread::sleep(Duration::from_millis(1500));
839-
or_panic!(conn.execute("NOTIFY test_notifications_next_timeout, 'foo'", &[],));
839+
or_panic!(conn.execute("NOTIFY test_notifications_next_timeout, 'foo'", &[]));
840840
});
841841

842842
let notifications = conn.notifications();
@@ -1181,7 +1181,7 @@ fn test_copy_out() {
11811181
CREATE TEMPORARY TABLE foo (id INT);
11821182
INSERT INTO foo (id) VALUES (0), (1), (2), (3)",
11831183
));
1184-
let stmt = or_panic!(conn.prepare("COPY (SELECT id FROM foo ORDER BY id) TO STDOUT",));
1184+
let stmt = or_panic!(conn.prepare("COPY (SELECT id FROM foo ORDER BY id) TO STDOUT"));
11851185
let mut buf = vec![];
11861186
let count = or_panic!(stmt.copy_out(&[], &mut buf));
11871187
assert_eq!(count, 4);
@@ -1200,7 +1200,7 @@ fn test_copy_out_error() {
12001200
CREATE TEMPORARY TABLE foo (id INT);
12011201
INSERT INTO foo (id) VALUES (0), (1), (2), (3)",
12021202
));
1203-
let stmt = or_panic!(conn.prepare("COPY (SELECT id FROM foo ORDER BY id) TO STDOUT (OIDS)",));
1203+
let stmt = or_panic!(conn.prepare("COPY (SELECT id FROM foo ORDER BY id) TO STDOUT (OIDS)"));
12041204
let mut buf = vec![];
12051205
let err = stmt.copy_out(&[], &mut buf).unwrap_err();
12061206
match err.as_db() {
@@ -1363,28 +1363,28 @@ fn test_transaction_isolation_level() {
13631363
or_panic!(conn.transaction_isolation())
13641364
);
13651365
or_panic!(conn.set_transaction_config(
1366-
transaction::Config::new().isolation_level(IsolationLevel::ReadUncommitted,),
1366+
transaction::Config::new().isolation_level(IsolationLevel::ReadUncommitted),
13671367
));
13681368
assert_eq!(
13691369
IsolationLevel::ReadUncommitted,
13701370
or_panic!(conn.transaction_isolation())
13711371
);
13721372
or_panic!(conn.set_transaction_config(
1373-
transaction::Config::new().isolation_level(IsolationLevel::RepeatableRead,),
1373+
transaction::Config::new().isolation_level(IsolationLevel::RepeatableRead),
13741374
));
13751375
assert_eq!(
13761376
IsolationLevel::RepeatableRead,
13771377
or_panic!(conn.transaction_isolation())
13781378
);
13791379
or_panic!(conn.set_transaction_config(
1380-
transaction::Config::new().isolation_level(IsolationLevel::Serializable,),
1380+
transaction::Config::new().isolation_level(IsolationLevel::Serializable),
13811381
));
13821382
assert_eq!(
13831383
IsolationLevel::Serializable,
13841384
or_panic!(conn.transaction_isolation())
13851385
);
13861386
or_panic!(conn.set_transaction_config(
1387-
transaction::Config::new().isolation_level(IsolationLevel::ReadCommitted,),
1387+
transaction::Config::new().isolation_level(IsolationLevel::ReadCommitted),
13881388
));
13891389
assert_eq!(
13901390
IsolationLevel::ReadCommitted,

0 commit comments

Comments
 (0)