Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-prosser committed Dec 14, 2023
1 parent fababa3 commit cab53b6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
4 changes: 3 additions & 1 deletion cli/src/commands/create/bucket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ pub fn create(client: &Client, args: &CreateBucketArgs, printer: &Printer) -> Re
transform_tag,
} = args;

let transform_tag = transform_tag.clone().unwrap_or(DEFAULT_TRANSFORM_TAG.clone());
let transform_tag = transform_tag
.clone()
.unwrap_or(DEFAULT_TRANSFORM_TAG.clone());

let bucket = client
.create_bucket(
Expand Down
28 changes: 14 additions & 14 deletions cli/src/commands/parse/mod.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
mod emls;
mod msgs;

use std::fs::DirEntry;
use std::path::PathBuf;
use std::sync::Arc;
use std::sync::atomic::{AtomicUsize, Ordering};
use colored::Colorize;
use anyhow::Result;
use colored::Colorize;
use reinfer_client::resources::bucket::FullName as BucketFullName;
use reinfer_client::resources::documents::Document;
use reinfer_client::{Client, NewEmail, Source, TransformTag};
use reinfer_client::{Client, NewEmail, Source, TransformTag};
use std::fs::DirEntry;
use std::path::PathBuf;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
use structopt::StructOpt;

use crate::progress::{Progress, Options as ProgressOptions};
use crate::progress::{Options as ProgressOptions, Progress};

use self::emls::ParseEmlArgs;
use self::msgs::ParseMsgArgs;
Expand Down Expand Up @@ -85,7 +85,7 @@ impl Statistics {
}
}

pub fn get_files_in_directory(directory: &PathBuf, extension:&str) -> Result<Vec<DirEntry>> {
pub fn get_files_in_directory(directory: &PathBuf, extension: &str) -> Result<Vec<DirEntry>> {
Ok(std::fs::read_dir(directory)?
.filter_map(|path| {
let path = path.ok()?;
Expand All @@ -103,8 +103,8 @@ fn upload_batch_of_new_emails(
bucket: &BucketFullName,
emails: &Vec<NewEmail>,
no_charge: bool,
statistics: &Arc<Statistics>) -> Result<()>{

statistics: &Arc<Statistics>,
) -> Result<()> {
client.put_emails(bucket, emails, no_charge)?;
statistics.add_uploaded(emails.len());
Ok(())
Expand All @@ -131,8 +131,8 @@ fn upload_batch_of_documents(

fn get_progress_bar(total_bytes: u64, statistics: &Arc<Statistics>) -> Progress {
Progress::new(
move |statistic| {
let num_processed = statistic.num_processed();
move |statistic| {
let num_processed = statistic.num_processed();
let num_failed = statistic.num_failed();
let num_uploaded = statistic.num_uploaded();
(
Expand All @@ -149,7 +149,7 @@ fn get_progress_bar(total_bytes: u64, statistics: &Arc<Statistics>) -> Progress
)
},
statistics,
Some(total_bytes),
ProgressOptions { bytes_units: false },
Some(total_bytes),
ProgressOptions { bytes_units: false },
)
}

0 comments on commit cab53b6

Please sign in to comment.