Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
quambene committed Dec 19, 2023
1 parent e1f6546 commit 5b8080c
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 23 deletions.
14 changes: 6 additions & 8 deletions src/data_loader/tabular_data.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
use std::path::PathBuf;

use crate::{
arg,
data_sources::{query_postgres, read_csv},
email_builder::Receiver,
};
use anyhow::{anyhow, Context};
use clap::ArgMatches;
use polars::{
chunked_array::ChunkedArray,
prelude::{DataFrame, TakeRandom, Utf8Type},
};

use crate::{
arg,
data_sources::{query_postgres, read_csv},
email_builder::Receiver,
};
use std::path::PathBuf;

pub struct TabularData;

Expand Down
3 changes: 1 addition & 2 deletions src/data_sources/csv.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::arg;
use anyhow::{anyhow, Context};
use clap::ArgMatches;
use polars::prelude::{CsvReader, CsvWriter, DataFrame, SerReader, SerWriter};
Expand All @@ -7,8 +8,6 @@ use std::{
time::SystemTime,
};

use crate::arg;

pub fn read_csv(csv_file: &Path) -> Result<DataFrame, anyhow::Error> {
println!("Reading csv file '{}' ...", csv_file.display());
let reader = CsvReader::from_path(csv_file)?.has_header(true);
Expand Down
8 changes: 5 additions & 3 deletions src/data_sources/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ mod image;
mod postgres;
mod ssh_tunnel;

pub use self::csv::{read_csv, write_csv};
pub use self::image::write_image;
pub use self::postgres::{query_postgres, ConnVars};
pub use self::{
csv::{read_csv, write_csv},
image::write_image,
postgres::{query_postgres, ConnVars},
};
pub use ssh_tunnel::SshTunnel;
3 changes: 1 addition & 2 deletions src/data_sources/postgres.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::{arg, data_sources::SshTunnel};
use anyhow::{Context, Result};
use clap::ArgMatches;
use connectorx::{
Expand All @@ -11,8 +12,6 @@ use postgres::NoTls;
use std::{env, fmt};
use url::Url;

use crate::{arg, data_sources::SshTunnel};

pub struct Password(pub String);

impl fmt::Debug for Password {
Expand Down
3 changes: 1 addition & 2 deletions src/email_builder/message/reader.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use std::{fs, path::Path};

use crate::arg;
use anyhow::anyhow;
use clap::ArgMatches;
use std::{fs, path::Path};

#[derive(Debug)]
pub struct Reader;
Expand Down
3 changes: 1 addition & 2 deletions src/email_builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ mod sender;

pub use bulk_email::BulkEmail;
pub use email::Email;
pub use message::Message;
pub use message::MessageTemplate;
pub use message::{Message, MessageTemplate};
pub use mime::MimeFormat;
pub use receiver::Receiver;
pub use sender::Sender;
Expand Down
3 changes: 1 addition & 2 deletions src/email_builder/sender.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use crate::arg;
use anyhow::anyhow;
use clap::ArgMatches;

use crate::arg;

pub struct Sender;

impl Sender {
Expand Down
3 changes: 1 addition & 2 deletions src/email_transmission/status.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::fmt;

use crate::helper::{format_green, format_red};
use std::fmt;

#[derive(Debug, Clone)]
pub enum Status {
Expand Down

0 comments on commit 5b8080c

Please sign in to comment.