Skip to content

Commit

Permalink
Apply Code review recommendations in error handling and style nits
Browse files Browse the repository at this point in the history
  • Loading branch information
fabrobles92 committed Apr 15, 2024
1 parent 5c263e4 commit 1c18eb5
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1,161 deletions.
6 changes: 4 additions & 2 deletions bin/sozo/src/commands/build.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use anyhow::Result;
use anyhow::{Context, Result};
use clap::Args;
use dojo_bindgen::{BuiltinPlugins, PluginManager};
use dojo_lang::scarb_internal::compile_workspace;
use prettytable::format::consts::FORMAT_NO_LINESEP_WITH_TITLE;
use prettytable::{format, Cell, Row, Table};
use scarb::core::{Config, TargetKind};
use scarb::ops::CompileOpts;
Expand Down Expand Up @@ -45,7 +46,7 @@ impl BuildArgs {
let target_dir = &compile_info.target_dir;
let contracts_statistics: Vec<ContractStatistics> =
get_contract_statistics_for_dir(target_dir)
.expect(format!("Error getting contracts in dir {target_dir}").as_str());
.context(format!("Error getting contracts stats"))?;
let table = create_stats_table(contracts_statistics);
table.printstd()
}
Expand Down Expand Up @@ -73,6 +74,7 @@ impl BuildArgs {

fn create_stats_table(contracts_statistics: Vec<ContractStatistics>) -> Table {
let mut table = Table::new();
table.set_format(*FORMAT_NO_LINESEP_WITH_TITLE);

// Add table headers
table.add_row(Row::new(vec![
Expand Down
Loading

0 comments on commit 1c18eb5

Please sign in to comment.