Skip to content

Commit c87f58b

Browse files
authored
refactor: use fully qualified paths in macros (#346)
1 parent 15f1894 commit c87f58b

File tree

16 files changed

+23
-27
lines changed

16 files changed

+23
-27
lines changed

etl-destinations/src/bigquery/validation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use chrono::{DateTime, NaiveDate, NaiveDateTime, NaiveTime, TimeZone, Utc};
2-
use etl::error::{ErrorKind, EtlError, EtlResult};
2+
use etl::error::{ErrorKind, EtlResult};
33
use etl::types::{ArrayCellNonOptional, CellNonOptional, PgNumeric};
44
use etl::{bail, etl_error};
55
use std::sync::LazyLock;

etl/src/conversions/bool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::bail;
2+
use crate::error::ErrorKind;
23
use crate::error::EtlResult;
3-
use crate::error::{ErrorKind, EtlError};
44

55
/// Parses a Postgres boolean value from its text format representation.
66
///

etl/src/conversions/event.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use std::sync::Arc;
77
use tokio_postgres::types::PgLsn;
88

99
use crate::conversions::text::{default_value_for_type, parse_cell_from_postgres_text};
10-
use crate::error::EtlError;
1110
use crate::error::{ErrorKind, EtlResult};
1211
use crate::store::schema::SchemaStore;
1312
use crate::types::{

etl/src/conversions/hex.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use crate::bail;
2-
use crate::error::EtlError;
32
use crate::error::{ErrorKind, EtlResult};
43

54
/// Converts a Postgres bytea hex string to a byte array.

etl/src/conversions/table_row.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use tracing::error;
44

55
use crate::bail;
66
use crate::conversions::text::parse_cell_from_postgres_text;
7-
use crate::error::EtlError;
87
use crate::error::{ErrorKind, EtlResult};
98
use crate::types::{Cell, TableRow};
109

etl/src/conversions/text.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use uuid::Uuid;
99
use crate::bail;
1010
use crate::conversions::numeric::PgNumeric;
1111
use crate::conversions::{bool::parse_bool, hex};
12-
use crate::error::{ErrorKind, EtlError, EtlResult};
12+
use crate::error::{ErrorKind, EtlResult};
1313
use crate::types::{ArrayCell, Cell};
1414

1515
/// Creates a default [`Cell`] value for the given Postgres type.

etl/src/failpoints.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
use fail::fail_point;
77

88
use crate::bail;
9-
use crate::error::{ErrorKind, EtlError, EtlResult};
9+
use crate::error::{ErrorKind, EtlResult};
1010

11-
pub const START_TABLE_SYNC__BEFORE_DATA_SYNC_SLOT_CREATION: &str =
11+
pub const START_TABLE_SYNC_BEFORE_DATA_SYNC_SLOT_CREATION: &str =
1212
"start_table_sync.before_data_sync_slot_creation";
13-
pub const START_TABLE_SYNC__DURING_DATA_SYNC: &str = "start_table_sync.during_data_sync";
13+
pub const START_TABLE_SYNC_DURING_DATA_SYNC: &str = "start_table_sync.during_data_sync";
1414

1515
/// Executes a configurable failpoint for testing error scenarios.
1616
///

etl/src/macros.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
#[macro_export]
1111
macro_rules! etl_error {
1212
($kind:expr, $desc:expr) => {
13-
EtlError::from(($kind, $desc))
13+
$crate::error::EtlError::from(($kind, $desc))
1414
};
1515
($kind:expr, $desc:expr, $detail:expr) => {
16-
EtlError::from(($kind, $desc, $detail.to_string()))
16+
$crate::error::EtlError::from(($kind, $desc, $detail.to_string()))
1717
};
1818
}
1919

@@ -24,9 +24,9 @@ macro_rules! etl_error {
2424
#[macro_export]
2525
macro_rules! bail {
2626
($kind:expr, $desc:expr) => {
27-
return Err($crate::etl_error!($kind, $desc))
27+
return ::core::result::Result::Err($crate::etl_error!($kind, $desc))
2828
};
2929
($kind:expr, $desc:expr, $detail:expr) => {
30-
return Err($crate::etl_error!($kind, $desc, $detail))
30+
return ::core::result::Result::Err($crate::etl_error!($kind, $desc, $detail))
3131
};
3232
}

etl/src/pipeline.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use crate::bail;
77
use crate::concurrency::shutdown::{ShutdownTx, create_shutdown_channel};
88
use crate::destination::Destination;
9-
use crate::error::{ErrorKind, EtlError, EtlResult};
9+
use crate::error::{ErrorKind, EtlResult};
1010
use crate::metrics::register_metrics;
1111
use crate::replication::client::PgReplicationClient;
1212
use crate::state::table::TableReplicationPhase;

etl/src/replication/apply.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use crate::conversions::event::{
2424
parse_event_from_update_message,
2525
};
2626
use crate::destination::Destination;
27-
use crate::error::{ErrorKind, EtlError, EtlResult};
27+
use crate::error::{ErrorKind, EtlResult};
2828
use crate::metrics::{
2929
APPLY, ETL_BATCH_SEND_DURATION_SECONDS, ETL_BATCH_SIZE, ETL_ITEMS_COPIED_TOTAL, MILLIS_PER_SEC,
3030
PHASE, PIPELINE_ID,

0 commit comments

Comments
 (0)