Skip to content

Commit 7ca3886

Browse files
authored
Fix error messages in core (#159)
**Stack**: - #168 - #167 - #166 - #165 - #164 - #163 - #160 - #159 ⬅ - #158 ⚠️ *Part of a stack created by [spr](https://github.com/ejoffe/spr). Do not merge manually using the UI - doing so may have unexpected results.*
1 parent 285c6c2 commit 7ca3886

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

crates/cairo-coverage-core/src/build/coverage_input.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub fn build(
3333
}: ExecutionData,
3434
filter: &StatementCategoryFilter,
3535
) -> CoverageInput {
36-
let casm_debug_info = compile(&program).expect("Failed to compile program to casm");
36+
let casm_debug_info = compile(&program).expect("failed to compile program to casm");
3737

3838
let statement_information_map =
3939
statement_information::build_map(coverage_annotations, profiler_annotations, filter);

crates/cairo-coverage-core/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub fn run(
5555
// Versioned programs and contract classes can represent the same piece of code,
5656
// so we merge the file coverage after processing them to avoid duplicate entries.
5757
.reduce(merge)
58-
.context("At least one trace file must be provided")?;
58+
.context("at least one trace file must be provided")?;
5959

6060
Ok(lcov::fmt_string(&coverage_data))
6161
}
@@ -66,5 +66,5 @@ fn scarb_metadata() -> Result<Metadata> {
6666
.inherit_stderr()
6767
.inherit_stdout()
6868
.exec()
69-
.context("error: could not gather project metadata from Scarb due to previous error")
69+
.context("could not gather project metadata from Scarb due to previous error")
7070
}

crates/cairo-coverage-core/src/loading/enriched_program.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ fn extract_versioned_program(
6767
) -> Result<(Program, DebugInfo)> {
6868
Ok((
6969
program,
70-
debug_info.context("Debug info not found in program")?,
70+
debug_info.context("debug info not found in program")?,
7171
))
7272
}
7373

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

@@ -96,7 +96,7 @@ fn deserialize_annotations<T: TryFromDebugInfo<Error = AnnotationsError>>(
9696
) -> Result<T> {
9797
const RECOMMENDED_CAIRO_PROFILE_TOML: &str = indoc! {
9898
r#"
99-
Perhaps you are missing the following entries in Scarb.toml:
99+
perhaps you are missing the following entries in Scarb.toml:
100100
101101
[profile.dev.cairo]
102102
unstable-add-statements-functions-debug-info = true

crates/cairo-coverage-core/src/loading/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ mod execution_infos;
2424
/// Utility function to read and deserialize a JSON file.
2525
fn read_and_deserialize<T: DeserializeOwned>(file_path: &Utf8PathBuf) -> Result<T> {
2626
let content = fs::read_to_string(file_path)
27-
.context(format!("Failed to read file at path: {file_path}"))?;
27+
.context(format!("failed to read file at path: {file_path}"))?;
2828

2929
serde_json::from_str(&content).context(format!(
30-
"Failed to deserialize JSON content from file at path: {file_path}"
30+
"failed to deserialize JSON content from file at path: {file_path}"
3131
))
3232
}

0 commit comments

Comments
 (0)