Skip to content

Commit

Permalink
Update clap II
Browse files Browse the repository at this point in the history
  • Loading branch information
quambene committed Apr 3, 2024
1 parent e502407 commit ff410e7
Show file tree
Hide file tree
Showing 6 changed files with 197 additions and 151 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ serde = { version = "1.0", features = ["derive"] }
serde_yaml = "0.9.34"
tokio = "1.37"
csv = "1.3"
clap = "4.5.4"
clap = { version = "4.5.4", features = ["cargo"] }
chrono = "0.4"
polars = { version = "0.32", features = ["dtype-u8"] }
connectorx = { version = "0.3.2", features = ["src_postgres", "dst_arrow2"] }
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub fn query(matches: &ArgMatches) -> Result<(), anyhow::Error> {
Some(query) => {
let now = Utc::now();
let conn_vars = ConnVars::from_env()?;
let ssh_tunnel = matches.get_one::<&str>(arg::SSH_TUNNEL).map(|arg| *arg);
let ssh_tunnel = matches.get_one::<&str>(arg::SSH_TUNNEL).copied();
let connection = DbConnection::new(&conn_vars, ssh_tunnel)?;
let mut df_query = sources::query_postgres(&connection, query)?;

Expand Down
2 changes: 1 addition & 1 deletion src/cmd/send_bulk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub fn send_bulk(matches: &ArgMatches) -> Result<(), anyhow::Error> {

let bulk_email = if matches.contains_id(arg::PERSONALIZE) {
if let Some(personalized_columns) = matches.get_many::<&str>(arg::PERSONALIZE) {
let personalized_columns = personalized_columns.map(|arg| *arg).collect::<Vec<_>>();
let personalized_columns = personalized_columns.copied().collect::<Vec<_>>();
BulkEmail::new(
sender,
&receivers,
Expand Down
2 changes: 1 addition & 1 deletion src/email_builder/receiver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl BulkReceiver {
match (receiver_query, receiver_path) {
(Some(query), None) => {
let conn_vars = ConnVars::from_env()?;
let ssh_tunnel = matches.get_one::<&str>(arg::SSH_TUNNEL).map(|arg| *arg);
let ssh_tunnel = matches.get_one::<&str>(arg::SSH_TUNNEL).copied();
let connection = DbConnection::new(&conn_vars, ssh_tunnel)?;
let df_receiver = sources::query_postgres(&connection, query)?;

Expand Down
Loading

0 comments on commit ff410e7

Please sign in to comment.