Skip to content

Commit b4c4b69

Browse files
committed
Fix some clippy warnings
1 parent 9c10682 commit b4c4b69

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

tests/test.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ fn test_lazy_query() {
403403
or_panic!(trans.execute("CREATE TEMPORARY TABLE foo (id INT PRIMARY KEY)", &[]));
404404
let stmt = or_panic!(trans.prepare("INSERT INTO foo (id) VALUES ($1)"));
405405
let values = vec!(0i32, 1, 2, 3, 4, 5);
406-
for value in values.iter() {
406+
for value in &values {
407407
or_panic!(stmt.execute(&[value]));
408408
}
409409
let stmt = or_panic!(trans.prepare("SELECT id FROM foo ORDER BY id"));
@@ -534,13 +534,13 @@ fn test_get_off_by_one() {
534534

535535
#[test]
536536
fn test_custom_notice_handler() {
537-
static mut count: usize = 0;
537+
static mut COUNT: usize = 0;
538538
struct Handler;
539539

540540
impl HandleNotice for Handler {
541541
fn handle_notice(&mut self, notice: DbError) {
542542
assert_eq!("note", notice.message);
543-
unsafe { count += 1; }
543+
unsafe { COUNT += 1; }
544544
}
545545
}
546546

@@ -554,7 +554,7 @@ fn test_custom_notice_handler() {
554554
END; $$ LANGUAGE plpgsql", &[]));
555555
or_panic!(conn.execute("SELECT pg_temp.note()", &[]));
556556

557-
assert_eq!(unsafe { count }, 1);
557+
assert_eq!(unsafe { COUNT }, 1);
558558
}
559559

560560
#[test]
@@ -1069,8 +1069,8 @@ fn transaction_config() {
10691069
#[test]
10701070
fn transaction_config_one_setting() {
10711071
let conn = Connection::connect("postgres://postgres@localhost", TlsMode::None).unwrap();
1072-
conn.set_transaction_config(&transaction::Config::new().read_only(true)).unwrap();
1073-
conn.set_transaction_config(&transaction::Config::new().deferrable(true)).unwrap();
1072+
conn.set_transaction_config(transaction::Config::new().read_only(true)).unwrap();
1073+
conn.set_transaction_config(transaction::Config::new().deferrable(true)).unwrap();
10741074
}
10751075

10761076
#[test]

tests/types/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -302,16 +302,16 @@ fn composite() {
302302
let stmt = conn.prepare("SELECT $1::inventory_item").unwrap();
303303
let type_ = &stmt.param_types()[0];
304304
assert_eq!(type_.name(), "inventory_item");
305-
match type_.kind() {
306-
&Kind::Composite(ref fields) => {
305+
match *type_.kind() {
306+
Kind::Composite(ref fields) => {
307307
assert_eq!(fields[0].name(), "name");
308308
assert_eq!(fields[0].type_(), &Type::Text);
309309
assert_eq!(fields[1].name(), "supplier");
310310
assert_eq!(fields[1].type_(), &Type::Int4);
311311
assert_eq!(fields[2].name(), "price");
312312
assert_eq!(fields[2].type_(), &Type::Numeric);
313313
}
314-
t => panic!("bad type {:?}", t),
314+
ref t => panic!("bad type {:?}", t),
315315
}
316316
}
317317

@@ -323,8 +323,8 @@ fn enum_() {
323323
let stmt = conn.prepare("SELECT $1::mood").unwrap();
324324
let type_ = &stmt.param_types()[0];
325325
assert_eq!(type_.name(), "mood");
326-
match type_.kind() {
327-
&Kind::Enum(ref variants) => {
326+
match *type_.kind() {
327+
Kind::Enum(ref variants) => {
328328
assert_eq!(variants, &["sad".to_owned(), "ok".to_owned(), "happy".to_owned()]);
329329
}
330330
_ => panic!("bad type"),

0 commit comments

Comments
 (0)