diff --git a/forc-pkg/src/pkg.rs b/forc-pkg/src/pkg.rs index 160b667074c..bf5baadbf6e 100644 --- a/forc-pkg/src/pkg.rs +++ b/forc-pkg/src/pkg.rs @@ -8,8 +8,8 @@ use crate::{ source::{self, IPFSNode, Source}, BuildProfile, }; -use byte_unit::{Byte, UnitType}; use anyhow::{anyhow, bail, Context, Error, Result}; +use byte_unit::{Byte, UnitType}; use forc_tracing::{println_action_green, println_warning}; use forc_util::{ default_output_directory, find_file_name, kebab_to_snake_case, print_compiling, @@ -498,7 +498,11 @@ impl BuiltPackage { let json_abi_path = output_dir.join(program_abi_stem).with_extension("json"); self.write_json_abi(&json_abi_path, minify)?; - debug!(" Bytecode size: {} bytes ({})", self.bytecode.bytes.len(), format_bytecode_size(self.bytecode.bytes.len())); + debug!( + " Bytecode size: {} bytes ({})", + self.bytecode.bytes.len(), + format_bytecode_size(self.bytecode.bytes.len()) + ); // Additional ops required depending on the program type match self.tree_type { TreeType::Contract => { @@ -2108,12 +2112,12 @@ fn profile_target_string(profile_name: &str, build_target: &BuildTarget) -> Stri }; format!("{profile_name} [{}] target(s)", targets.join(" + ")) } - /// Returns the size of the bytecode in a human-readable format. - pub fn format_bytecode_size(bytes_len: usize) -> String { - let size = Byte::from_u64(bytes_len as u64); - let adjusted_byte = size.get_appropriate_unit(UnitType::Decimal); - adjusted_byte.to_string() - } +/// Returns the size of the bytecode in a human-readable format. +pub fn format_bytecode_size(bytes_len: usize) -> String { + let size = Byte::from_u64(bytes_len as u64); + let adjusted_byte = size.get_appropriate_unit(UnitType::Decimal); + adjusted_byte.to_string() +} /// Check if the given node is a contract dependency of any node in the graph. fn is_contract_dependency(graph: &Graph, node: NodeIx) -> bool { @@ -2180,7 +2184,10 @@ pub fn build_with_options(build_options: &BuildOpts) -> Result { }, )?; let output_dir = pkg.output_directory.as_ref().map(PathBuf::from); - let total_size = built_packages.iter().map(|(_, pkg)| pkg.bytecode.bytes.len()).sum::(); + let total_size = built_packages + .iter() + .map(|(_, pkg)| pkg.bytecode.bytes.len()) + .sum::(); println_action_green( "Finished",