Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/cairo-coverage-core/src/build/coverage_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub fn build(
}: ExecutionData,
filter: &StatementCategoryFilter,
) -> CoverageInput {
let casm_debug_info = compile(&program).expect("Failed to compile program to casm");
let casm_debug_info = compile(&program).expect("failed to compile program to casm");

let statement_information_map =
statement_information::build_map(coverage_annotations, profiler_annotations, filter);
Expand Down
4 changes: 2 additions & 2 deletions crates/cairo-coverage-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub fn run(
// Versioned programs and contract classes can represent the same piece of code,
// so we merge the file coverage after processing them to avoid duplicate entries.
.reduce(merge)
.context("At least one trace file must be provided")?;
.context("at least one trace file must be provided")?;

Ok(lcov::fmt_string(&coverage_data))
}
Expand All @@ -66,5 +66,5 @@ fn scarb_metadata() -> Result<Metadata> {
.inherit_stderr()
.inherit_stdout()
.exec()
.context("error: could not gather project metadata from Scarb due to previous error")
.context("could not gather project metadata from Scarb due to previous error")
}
6 changes: 3 additions & 3 deletions crates/cairo-coverage-core/src/loading/enriched_program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ fn extract_versioned_program(
) -> Result<(Program, DebugInfo)> {
Ok((
program,
debug_info.context("Debug info not found in program")?,
debug_info.context("debug info not found in program")?,
))
}

Expand All @@ -76,7 +76,7 @@ fn extract_contract_class(contract_class: ContractClass) -> Result<(Program, Deb
let program = contract_class.extract_sierra_program()?;
let debug_info = contract_class
.sierra_program_debug_info
.context("Debug info not found in contract")?;
.context("debug info not found in contract")?;
Ok((program, debug_info))
}

Expand All @@ -96,7 +96,7 @@ fn deserialize_annotations<T: TryFromDebugInfo<Error = AnnotationsError>>(
) -> Result<T> {
const RECOMMENDED_CAIRO_PROFILE_TOML: &str = indoc! {
r#"
Perhaps you are missing the following entries in Scarb.toml:
perhaps you are missing the following entries in Scarb.toml:

[profile.dev.cairo]
unstable-add-statements-functions-debug-info = true
Expand Down
4 changes: 2 additions & 2 deletions crates/cairo-coverage-core/src/loading/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ mod execution_infos;
/// Utility function to read and deserialize a JSON file.
fn read_and_deserialize<T: DeserializeOwned>(file_path: &Utf8PathBuf) -> Result<T> {
let content = fs::read_to_string(file_path)
.context(format!("Failed to read file at path: {file_path}"))?;
.context(format!("failed to read file at path: {file_path}"))?;

serde_json::from_str(&content).context(format!(
"Failed to deserialize JSON content from file at path: {file_path}"
"failed to deserialize JSON content from file at path: {file_path}"
))
}
Loading