Skip to content

Commit 5682519

Browse files
committed
chore: rustfmt
1 parent 098209d commit 5682519

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

src/fdw/convert.rs

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,13 @@ pub fn validate_arrow_type_for_pg_oid(
120120
pg_sys::TEXTOID,
121121
"arrow utf8 requires postgres text",
122122
),
123-
DataType::Binary | DataType::LargeBinary | DataType::FixedSizeBinary(_) => require_target_oid(
124-
target_type_oid,
125-
pg_sys::BYTEAOID,
126-
"arrow binary requires postgres bytea",
127-
),
123+
DataType::Binary | DataType::LargeBinary | DataType::FixedSizeBinary(_) => {
124+
require_target_oid(
125+
target_type_oid,
126+
pg_sys::BYTEAOID,
127+
"arrow binary requires postgres bytea",
128+
)
129+
}
128130
DataType::Date32 | DataType::Date64 => require_target_oid(
129131
target_type_oid,
130132
pg_sys::DATEOID,
@@ -150,7 +152,9 @@ pub fn validate_arrow_type_for_pg_oid(
150152
pg_sys::NUMERICOID,
151153
"arrow decimal requires postgres numeric",
152154
),
153-
DataType::Dictionary(_, value) => validate_arrow_type_for_pg_oid(value.as_ref(), target_type_oid),
155+
DataType::Dictionary(_, value) => {
156+
validate_arrow_type_for_pg_oid(value.as_ref(), target_type_oid)
157+
}
154158
DataType::List(elem) | DataType::LargeList(elem) | DataType::FixedSizeList(elem, _) => {
155159
if target_type_oid == pg_sys::JSONBOID {
156160
return Ok(());
@@ -622,10 +626,11 @@ pub fn arrow_value_to_datum(
622626
.downcast_ref::<Decimal128Array>()
623627
.ok_or_else(|| ConvertError::internal("invalid decimal128 array"))?
624628
.value_as_string(row_idx);
625-
let numeric =
626-
AnyNumeric::try_from(v.as_str()).map_err(|_| ConvertError::internal("invalid numeric"))?;
629+
let numeric = AnyNumeric::try_from(v.as_str())
630+
.map_err(|_| ConvertError::internal("invalid numeric"))?;
627631
Ok((
628-
numeric.into_datum()
632+
numeric
633+
.into_datum()
629634
.ok_or_else(|| ConvertError::internal("failed to convert numeric"))?,
630635
false,
631636
))
@@ -641,10 +646,11 @@ pub fn arrow_value_to_datum(
641646
.downcast_ref::<Decimal256Array>()
642647
.ok_or_else(|| ConvertError::internal("invalid decimal256 array"))?
643648
.value_as_string(row_idx);
644-
let numeric =
645-
AnyNumeric::try_from(v.as_str()).map_err(|_| ConvertError::internal("invalid numeric"))?;
649+
let numeric = AnyNumeric::try_from(v.as_str())
650+
.map_err(|_| ConvertError::internal("invalid numeric"))?;
646651
Ok((
647-
numeric.into_datum()
652+
numeric
653+
.into_datum()
648654
.ok_or_else(|| ConvertError::internal("failed to convert numeric"))?,
649655
false,
650656
))

src/tests.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,7 @@ CREATE SERVER {server} FOREIGN DATA WRAPPER lance_fdw;\n\n"
396396
.expect("create table");
397397
let struct_list_uri = struct_list_path.to_str().unwrap();
398398

399-
let overflow_path = gen
400-
.create_table_with_u64_overflow()
401-
.expect("create table");
399+
let overflow_path = gen.create_table_with_u64_overflow().expect("create table");
402400
let overflow_uri = overflow_path.to_str().unwrap();
403401

404402
Spi::run("DROP SCHEMA IF EXISTS slt_unit CASCADE").expect("drop schema");

0 commit comments

Comments
 (0)