File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11//! Code for reading in the commodity levies CSV file.
2- use super :: super :: { input_err_msg, read_csv , try_insert} ;
2+ use super :: super :: { input_err_msg, read_csv_optional , try_insert} ;
33use crate :: commodity:: { BalanceType , CommodityID , CommodityLevy , CommodityLevyMap } ;
44use crate :: id:: IDCollection ;
55use crate :: region:: { RegionID , parse_region_str} ;
@@ -44,7 +44,7 @@ struct CommodityLevyRaw {
4444///
4545/// # Returns
4646///
47- /// A map containing levies, grouped by commodity ID.
47+ /// A map containing levies, grouped by commodity ID or an error .
4848pub fn read_commodity_levies (
4949 model_dir : & Path ,
5050 commodity_ids : & IndexSet < CommodityID > ,
@@ -53,7 +53,7 @@ pub fn read_commodity_levies(
5353 milestone_years : & [ u32 ] ,
5454) -> Result < HashMap < CommodityID , CommodityLevyMap > > {
5555 let file_path = model_dir. join ( COMMODITY_LEVIES_FILE_NAME ) ;
56- let commodity_levies_csv = read_csv :: < CommodityLevyRaw > ( & file_path) ?;
56+ let commodity_levies_csv = read_csv_optional ( & file_path) ?;
5757 read_commodity_levies_iter (
5858 commodity_levies_csv,
5959 commodity_ids,
You can’t perform that action at this time.
0 commit comments