Skip to content

Commit 7f28d0e

Browse files
committed
refactor: remove unused custom domain type and update imports in tests
- Removed the unused RangeInclusive struct from derives.rs - Added #[allow(unused_imports)] to macros.rs and types.rs to suppress warnings
1 parent b238bdb commit 7f28d0e

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

tests/postgres/derives.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,6 @@ struct InventoryItem {
129129
#[sqlx(type_name = "float_range")]
130130
struct FloatRange(PgRange<f64>);
131131

132-
// Custom domain type
133-
#[derive(sqlx_oldapi::Type, Debug)]
134-
#[sqlx(type_name = "int4rangeL0pC")]
135-
struct RangeInclusive(PgRange<i32>);
136-
137132
test_type!(transparent<Transparent>(Postgres,
138133
"0" == Transparent(0),
139134
"23523" == Transparent(23523)

tests/postgres/macros.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#[allow(unused_imports)]
12
use sqlx_oldapi as sqlx;
23
use sqlx_oldapi::{Connection, PgConnection, Postgres, Transaction};
34
use sqlx_test::new;

tests/postgres/types.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ use std::ops::Bound;
55
use sqlx_oldapi::postgres::types::{Oid, PgInterval, PgMoney, PgRange};
66
use sqlx_oldapi::postgres::Postgres;
77
use sqlx_test::{test_decode_type, test_prepared_type, test_type};
8+
9+
#[allow(unused_imports)]
810
use std::str::FromStr;
911

1012
test_type!(null<Option<i16>>(Postgres,
@@ -286,7 +288,7 @@ mod chrono {
286288

287289
test_type!(chrono_date_time_tz_utc<DateTime::<Utc>>(Postgres,
288290
"TIMESTAMPTZ '2019-01-02 05:10:20.115100'"
289-
== DateTime::from_naive_utc_and_offset(
291+
== DateTime::<Utc>::from_naive_utc_and_offset(
290292
NaiveDate::from_ymd_opt(2019, 1, 2).unwrap().and_hms_micro_opt(5, 10, 20, 115100).unwrap(),
291293
Utc,
292294
)
@@ -300,7 +302,7 @@ mod chrono {
300302
test_type!(chrono_date_time_tz_vec<Vec<DateTime::<Utc>>>(Postgres,
301303
"array['2019-01-02 05:10:20.115100']::timestamptz[]"
302304
== vec![
303-
DateTime::from_naive_utc_and_offset(
305+
DateTime::<Utc>::from_naive_utc_and_offset(
304306
NaiveDate::from_ymd_opt(2019, 1, 2).unwrap().and_hms_micro_opt(5, 10, 20, 115100).unwrap(),
305307
Utc,
306308
)

0 commit comments

Comments
 (0)