From 2351db6838fe1fbc4078fbddcdfd11aa01d633f6 Mon Sep 17 00:00:00 2001 From: scoobybejesus Date: Sat, 21 Sep 2019 23:26:55 -0400 Subject: [PATCH] Limited public visibility of certain fn's to within the crate only. --- src/cli_user_choices.rs | 2 +- src/core_functions.rs | 4 ++-- src/create_lots_mvmts.rs | 2 +- src/csv_import_accts_txns.rs | 4 ++-- src/import_cost_proceeds_etc.rs | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/cli_user_choices.rs b/src/cli_user_choices.rs index 5c5654f..f88f993 100644 --- a/src/cli_user_choices.rs +++ b/src/cli_user_choices.rs @@ -169,7 +169,7 @@ pub fn inv_costing_from_cmd_arg(arg: String) -> Result) -> Result<(bool, String), Box> { +pub(crate) fn elect_like_kind_treatment(cutoff_date_arg: &Option) -> Result<(bool, String), Box> { match cutoff_date_arg { diff --git a/src/core_functions.rs b/src/core_functions.rs index 7d8b4a5..ad92833 100644 --- a/src/core_functions.rs +++ b/src/core_functions.rs @@ -54,7 +54,7 @@ pub struct ImportProcessParameters { pub lk_cutoff_date_string: String, } -pub fn import_and_process_final( +pub(crate) fn import_and_process_final( input_file_path: PathBuf, settings: &ImportProcessParameters, ) -> Result<( @@ -87,7 +87,7 @@ pub fn import_and_process_final( } }; - pub fn import_from_csv( + pub(crate) fn import_from_csv( import_file_path: PathBuf, transactions_map: &mut HashMap, action_records: &mut HashMap, diff --git a/src/create_lots_mvmts.rs b/src/create_lots_mvmts.rs index fb59428..ec0612e 100644 --- a/src/create_lots_mvmts.rs +++ b/src/create_lots_mvmts.rs @@ -14,7 +14,7 @@ use crate::account::{Account, RawAccount, Lot, Movement}; use crate::core_functions::{InventoryCostingMethod, LikeKindSettings, ImportProcessParameters}; use crate::decimal_utils::{round_d128_1e8}; -pub fn create_lots_and_movements( +pub(crate) fn create_lots_and_movements( txns_map: HashMap, settings: &ImportProcessParameters, likekind_settings: &Option, diff --git a/src/csv_import_accts_txns.rs b/src/csv_import_accts_txns.rs index 8995431..8a37744 100644 --- a/src/csv_import_accts_txns.rs +++ b/src/csv_import_accts_txns.rs @@ -15,7 +15,7 @@ use crate::account::{Account, RawAccount}; use crate::decimal_utils::{round_d128_1e8}; -pub fn import_accounts( +pub(crate) fn import_accounts( rdr: &mut csv::Reader, raw_acct_map: &mut HashMap, acct_map: &mut HashMap, @@ -113,7 +113,7 @@ pub fn import_accounts( Ok(()) } -pub fn import_transactions( +pub(crate) fn import_transactions( rdr: &mut csv::Reader, txns_map: &mut HashMap, action_records: &mut HashMap, diff --git a/src/import_cost_proceeds_etc.rs b/src/import_cost_proceeds_etc.rs index 3558578..2effc0b 100644 --- a/src/import_cost_proceeds_etc.rs +++ b/src/import_cost_proceeds_etc.rs @@ -12,7 +12,7 @@ use crate::account::{Account, RawAccount}; use crate::decimal_utils::{round_d128_1e2}; use crate::core_functions::{ImportProcessParameters}; -pub fn add_cost_basis_to_movements( +pub(crate) fn add_cost_basis_to_movements( settings: &ImportProcessParameters, ars: &HashMap, raw_acct_map: &HashMap, @@ -187,7 +187,7 @@ pub fn add_cost_basis_to_movements( Ok(()) } -pub fn add_proceeds_to_movements( +pub(crate) fn add_proceeds_to_movements( ars: &HashMap, raw_acct_map: &HashMap, acct_map: &HashMap, @@ -261,7 +261,7 @@ pub fn add_proceeds_to_movements( Ok(()) } -pub fn apply_like_kind_treatment( +pub(crate) fn apply_like_kind_treatment( cutoff_date: NaiveDate, settings: &ImportProcessParameters, ars: &HashMap,