Skip to content

Commit

Permalink
Reduce visibility of some methods/structs
Browse files Browse the repository at this point in the history
  • Loading branch information
cptartur committed Oct 23, 2024
1 parent 04921f9 commit e022e07
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions crates/scarb-api/src/artifacts/deserialized.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ use serde::Deserialize;
use std::fs;

#[derive(Deserialize, Debug, PartialEq, Clone)]
pub(crate) struct StarknetArtifacts {
pub(super) struct StarknetArtifacts {
pub version: u32,
pub contracts: Vec<StarknetContract>,
}

#[allow(dead_code)]
#[derive(Deserialize, Debug, PartialEq, Clone)]
pub(crate) struct StarknetContract {
pub(super) struct StarknetContract {
pub id: String,
pub package_name: String,
pub contract_name: String,
Expand All @@ -20,7 +20,7 @@ pub(crate) struct StarknetContract {

#[allow(dead_code)]
#[derive(Deserialize, Debug, PartialEq, Clone)]
pub(crate) struct StarknetContractArtifactPaths {
pub(super) struct StarknetContractArtifactPaths {
pub sierra: Utf8PathBuf,
}

Expand All @@ -29,7 +29,7 @@ pub(crate) struct StarknetContractArtifactPaths {
/// # Arguments
///
/// * `path` - A path to `starknet_artifacts.json` file.
pub(crate) fn artifacts_for_package(path: &Utf8Path) -> Result<StarknetArtifacts> {
pub(super) fn artifacts_for_package(path: &Utf8Path) -> Result<StarknetArtifacts> {
let starknet_artifacts =
fs::read_to_string(path).with_context(|| format!("Failed to read {path:?} contents"))?;
let starknet_artifacts: StarknetArtifacts =
Expand Down
6 changes: 3 additions & 3 deletions crates/scarb-api/src/artifacts/representation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ use crate::artifacts::deserialized::{artifacts_for_package, StarknetArtifacts};
use anyhow::anyhow;
use camino::{Utf8Path, Utf8PathBuf};

pub struct StarknetArtifactsRepresentation {
pub(super) struct StarknetArtifactsRepresentation {
path: Utf8PathBuf,
artifacts: StarknetArtifacts,
}

impl StarknetArtifactsRepresentation {
pub fn try_from_path(path: &Utf8Path) -> anyhow::Result<Self> {
pub(super) fn try_from_path(path: &Utf8Path) -> anyhow::Result<Self> {
let artifacts = artifacts_for_package(path)?;
let path = path
.parent()
Expand All @@ -18,7 +18,7 @@ impl StarknetArtifactsRepresentation {
Ok(Self { path, artifacts })
}

pub fn artifacts(self) -> Vec<(String, Utf8PathBuf)> {
pub(super) fn artifacts(self) -> Vec<(String, Utf8PathBuf)> {
self.artifacts
.contracts
.into_iter()
Expand Down

0 comments on commit e022e07

Please sign in to comment.