Skip to content

Commit

Permalink
ran cargo fmt to fix formating errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mvonbodun committed May 7, 2022
1 parent 17ffa50 commit 4d21780
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions impex/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct Command {
sku_file: String,
concurrency: usize,
rate_limit: NonZeroU32,
skip_cat_lookup: usize
skip_cat_lookup: usize,
}

arg_enum! {
Expand Down Expand Up @@ -676,7 +676,7 @@ impl Command {
sku_file: "".to_string(),
concurrency: 1,
rate_limit: NonZeroU32::new(1).unwrap(),
skip_cat_lookup: 0
skip_cat_lookup: 0,
};

match matches.subcommand() {
Expand Down Expand Up @@ -997,7 +997,7 @@ pub async fn run() -> Result<(), Box<dyn Error>> {
environment,
cmd.concurrency,
cmd.rate_limit,
cmd.skip_cat_lookup
cmd.skip_cat_lookup,
)
.await?;
} else if cmd.action.eq("update") {
Expand All @@ -1008,7 +1008,7 @@ pub async fn run() -> Result<(), Box<dyn Error>> {
environment,
cmd.concurrency,
cmd.rate_limit,
cmd.skip_cat_lookup
cmd.skip_cat_lookup,
)
.await?;
}
Expand Down
12 changes: 6 additions & 6 deletions impex/src/products.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ pub async fn load_products(
environment: String,
concurrent_requests: usize,
rate_limit: NonZeroU32,
skip_cat_lookup: usize
skip_cat_lookup: usize,
) -> Result<(), Box<dyn Error>> {
info!("Starting load of products");
// Read in the category tree and store in a HashMap for lookup
let mut categories = Vec::new();
let mut category_lookup: HashMap<String, i32> = HashMap::new();
let mut category_identifier_name_lookup: HashMap<String, String> = HashMap::new();

if skip_cat_lookup == 0 {
categories = utils::get_vtex_category_tree(client, &account_name, &environment).await;
category_lookup = utils::parse_category_tree(categories);
debug!("category_lookup: {:?}", category_lookup.len());

// Get a lookup for the cateogory name of a category by GroupIdentifier
category_identifier_name_lookup =
utils::create_category_name_lookup(client, &account_name, &environment).await;
Expand Down Expand Up @@ -126,20 +126,20 @@ pub async fn update_products(
environment: String,
concurrent_requests: usize,
rate_limit: NonZeroU32,
skip_cat_lookup: usize
skip_cat_lookup: usize,
) -> Result<(), Box<dyn Error>> {
info!("Starting load of products");
// Read in the category tree and store in a HashMap for lookup
let mut categories = Vec::new();
let mut category_lookup: HashMap<String, i32> = HashMap::new();
let mut category_identifier_name_lookup: HashMap<String, String> = HashMap::new();

debug!("skip_cat_lookup={}", skip_cat_lookup);
if skip_cat_lookup == 0 {
categories = utils::get_vtex_category_tree(client, &account_name, &environment).await;
category_lookup = utils::parse_category_tree(categories);
debug!("category_lookup: {:?}", category_lookup.len());

// Get a lookup for the cateogory name of a category by GroupIdentifier
category_identifier_name_lookup =
utils::create_category_name_lookup(client, &account_name, &environment).await;
Expand Down

0 comments on commit 4d21780

Please sign in to comment.