Skip to content

Commit

Permalink
use row named email
Browse files Browse the repository at this point in the history
  • Loading branch information
beckend committed Oct 7, 2023
1 parent 7dacaa1 commit b894d47
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = 'email-validate'
version = '0.1.10'
version = '0.1.11'
edition = '2021'
keywords = ['email', 'validation', 'validate', 'bounce', 'free']
categories = ['email', 'validation']
Expand Down
34 changes: 13 additions & 21 deletions src/features/cli/commands/email_check/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,13 +355,11 @@ impl Api {

let mut buf_writer = Self::get_file_writer(&path_write).await?;

for (index, x) in items.into_iter().enumerate() {
let d = if index == 0 {
x.address_email.to_string()
} else {
format!(";{}", x.address_email)
};
Self::write_bytes_to_file(&mut buf_writer, d.as_bytes()).await?;
Self::write_bytes_to_file(&mut buf_writer, "email\n".as_bytes()).await?;

for x in items.into_iter() {
Self::write_bytes_to_file(&mut buf_writer, format!("{}\n", x.address_email).as_bytes())
.await?;
}

buf_writer.flush().await?;
Expand Down Expand Up @@ -458,14 +456,11 @@ impl Api {
.sort_by(|a, b| b.address_email.cmp(&a.address_email));

let mut buf_writer = Self::get_file_writer(&path_write).await?;
Self::write_bytes_to_file(&mut buf_writer, "email\n".as_bytes()).await?;

for (index, x) in state_c.timeouts.into_iter().enumerate() {
let d = if index == 0 {
x.address_email.to_string()
} else {
format!(";{}", x.address_email)
};
Self::write_bytes_to_file(&mut buf_writer, d.as_bytes()).await?;
for x in state_c.timeouts.into_iter() {
Self::write_bytes_to_file(&mut buf_writer, format!("{}\n", x.address_email).as_bytes())
.await?;
}

buf_writer.flush().await?;
Expand Down Expand Up @@ -780,14 +775,11 @@ impl Api {
});

let mut buf_writer = Self::get_file_writer(&path_write_all_valids).await?;
Self::write_bytes_to_file(&mut buf_writer, "email\n".as_bytes()).await?;

for (index, x) in items.into_iter().enumerate() {
let d = if index == 0 {
x.address_email.to_string()
} else {
format!(";{}", x.address_email)
};
Self::write_bytes_to_file(&mut buf_writer, d.as_bytes()).await?;
for x in items.into_iter() {
Self::write_bytes_to_file(&mut buf_writer, format!("{}\n", x.address_email).as_bytes())
.await?;
}

buf_writer.flush().await?;
Expand Down

0 comments on commit b894d47

Please sign in to comment.