Skip to content

Commit

Permalink
fix: update visibility of other objects to respect CliError
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed Feb 24, 2023
1 parent 4b8f03a commit a5a32c7
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion crates/nargo/src/cli/compile_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ fn compile_and_preprocess_circuit<P: AsRef<Path>>(
Ok(circuit_path)
}

pub fn compile_circuit<P: AsRef<Path>>(
pub(crate) fn compile_circuit<P: AsRef<Path>>(
program_dir: P,
compile_options: &CompileOptions,
) -> Result<noirc_driver::CompiledProgram, CliError> {
Expand Down
4 changes: 2 additions & 2 deletions crates/nargo/src/cli/fs/inputs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use super::write_to_file;
/// let (input_map, return_value): (InputMap, Option<InputValue>) =
/// read_inputs_from_file(path, "Verifier", Format::Toml, &abi)?;
/// ```
pub fn read_inputs_from_file<P: AsRef<Path>>(
pub(crate) fn read_inputs_from_file<P: AsRef<Path>>(
path: P,
file_name: &str,
format: Format,
Expand All @@ -42,7 +42,7 @@ pub fn read_inputs_from_file<P: AsRef<Path>>(
Ok((input_map, return_value))
}

pub fn write_inputs_to_file<P: AsRef<Path>>(
pub(crate) fn write_inputs_to_file<P: AsRef<Path>>(
input_map: &InputMap,
return_value: &Option<InputValue>,
path: P,
Expand Down
2 changes: 1 addition & 1 deletion crates/nargo/src/cli/fs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub(crate) fn write_to_file(bytes: &[u8], path: &Path) -> String {
}
}

pub fn load_hex_data<P: AsRef<Path>>(path: P) -> Result<Vec<u8>, CliError> {
pub(crate) fn load_hex_data<P: AsRef<Path>>(path: P) -> Result<Vec<u8>, CliError> {
let hex_data: Vec<_> =
std::fs::read(&path).map_err(|_| CliError::PathNotValid(path.as_ref().to_path_buf()))?;

Expand Down
2 changes: 1 addition & 1 deletion crates/nargo/src/cli/gates_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub(crate) fn run(_args: GatesCommand, config: NargoConfig) -> Result<(), CliErr
count_gates_with_path(config.program_dir, &CompileOptions::from(config.compile_options))
}

pub fn count_gates_with_path<P: AsRef<Path>>(
fn count_gates_with_path<P: AsRef<Path>>(
program_dir: P,
compile_options: &CompileOptions,
) -> Result<(), CliError> {
Expand Down
2 changes: 1 addition & 1 deletion crates/nargo/src/cli/prove_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub(crate) fn run(args: ProveCommand, config: NargoConfig) -> Result<(), CliErro
Ok(())
}

pub fn prove_with_path<P: AsRef<Path>>(
pub(crate) fn prove_with_path<P: AsRef<Path>>(
proof_name: Option<String>,
program_dir: P,
proof_dir: P,
Expand Down
2 changes: 1 addition & 1 deletion crates/nargo/src/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct CachedDep {
/// or it uses the repo on the cache.
/// Downloading will be recursive, so if a package contains packages
/// We need to download those too
pub struct Resolver<'a> {
pub(crate) struct Resolver<'a> {
cached_packages: HashMap<PathBuf, (CrateId, CachedDep)>,
driver: &'a mut Driver,
}
Expand Down
2 changes: 1 addition & 1 deletion crates/nargo/src/toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub enum Dependency {
/// Parses a Nargo.toml file from it's path
/// The path to the toml file must be present.
/// Calling this function without this guarantee is an ICE.
pub fn parse<P: AsRef<Path>>(path_to_toml: P) -> Result<Config, CliError> {
pub(crate) fn parse<P: AsRef<Path>>(path_to_toml: P) -> Result<Config, CliError> {
let toml_as_string =
std::fs::read_to_string(&path_to_toml).expect("ice: path given for toml file is invalid");

Expand Down

0 comments on commit a5a32c7

Please sign in to comment.