Skip to content

Commit 8f46c2b

Browse files
authored
chore: fix grammatical errors and improve clarity in code (#8959)
Signed-off-by: xiaolinny <[email protected]>
1 parent 5f72f10 commit 8f46c2b

File tree

9 files changed

+21
-21
lines changed

9 files changed

+21
-21
lines changed

corelib/src/test/print_test.cairo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ fn test_prints() {
7878
x.append(@suffix);
7979
print_byte_array_as_string(@x);
8080

81-
// Valid string with a non printable character.
81+
// Valid string with a non-printable character.
8282
let mut x: ByteArray = "Hello";
83-
x.append_byte(0x11); // Non printable character.
83+
x.append_byte(0x11); // Non-printable character.
8484
let suffix: ByteArray = "world";
8585
x.append(@suffix);
8686
print_byte_array_as_string(@x);

crates/cairo-lang-defs/src/ids.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ impl<'db> GenericItemId<'db> {
942942
// `parent1.parent()` is safe.
943943
let parent0_ptr = SyntaxStablePtrId(parent0);
944944
match parent1.parent(db).map(|p| p.kind(db)) {
945-
// SyntaxFile is root level (file level)
945+
// SyntaxFile is root level (file-level)
946946
Some(SyntaxKind::SyntaxFile) | Some(SyntaxKind::ModuleBody) => {
947947
GenericItemId::ModuleItem(GenericModuleItemId::FreeFunc(
948948
FreeFunctionLongId(

crates/cairo-lang-filesystem/src/span.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ use crate::ids::FileId;
1212
#[path = "span_test.rs"]
1313
mod test;
1414

15-
/// Byte length of an utf8 string.
16-
// This wrapper type is used to avoid confusion with non-utf8 sizes.
15+
/// Byte length of a UTF-8 string.
16+
// This wrapper type is used to avoid confusion with non-UTF-8 sizes.
1717
#[derive(
1818
Copy,
1919
Clone,
@@ -82,7 +82,7 @@ impl Sum for TextWidth {
8282
}
8383
}
8484

85-
/// Byte offset inside a utf8 string.
85+
/// Byte offset inside a UTF-8 string.
8686
#[derive(
8787
Copy,
8888
Clone,
@@ -274,7 +274,7 @@ pub struct FileSummary {
274274
pub last_offset: TextOffset,
275275
}
276276
impl FileSummary {
277-
/// Gets the number of lines
277+
/// Gets the number of lines.
278278
pub fn line_count(&self) -> usize {
279279
self.line_offsets.len()
280280
}

crates/cairo-lang-lowering/src/db.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ pub trait LoweringGroup: Database {
155155
module_lowering_diagnostics(self.as_dyn_database(), (), module_id)
156156
}
157157

158-
/// Aggregates file level lowering diagnostics.
158+
/// Aggregates file-level lowering diagnostics.
159159
fn file_lowering_diagnostics<'db>(
160160
&'db self,
161161
file_id: FileId<'db>,

crates/cairo-lang-runner/src/casm_run/test.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ fn test_as_cairo_short_string() {
199199
assert_eq!(as_cairo_short_string(&Felt252::from(0x6100)), Some("a".to_string()));
200200
assert_eq!(as_cairo_short_string(&Felt252::from(0x61000000)), Some("a".to_string()));
201201

202-
// With a non printable character.
202+
// With a non-printable character.
203203
assert_eq!(as_cairo_short_string(&Felt252::from(0x610162)), None);
204204
}
205205

@@ -226,7 +226,7 @@ fn test_as_cairo_short_string_ex() {
226226
assert_eq!(as_cairo_short_string_ex(&Felt252::from(0x6100), 2), Some(r"a\0".to_string()));
227227
assert_eq!(as_cairo_short_string_ex(&Felt252::from(0x610062), 3), Some(r"a\0b".to_string()));
228228

229-
// With a non printable character.
229+
// With a non-printable character.
230230
assert_eq!(as_cairo_short_string_ex(&Felt252::from(0x610162), 3), Some(r"a\x01b".to_string()));
231231

232232
// More data than expected.
@@ -406,7 +406,7 @@ fn test_format_for_debug() {
406406
// Valid string with Null.
407407
let felts = vec![
408408
Felt252::from_hex_unchecked(BYTE_ARRAY_MAGIC),
409-
// No full word.
409+
// No full words.
410410
Felt252::from(0),
411411
// pending word: 'Hello\0world'
412412
Felt252::from_hex_unchecked("48656c6c6f00776f726c64"),
@@ -418,7 +418,7 @@ fn test_format_for_debug() {
418418
// Valid string with a non printable character.
419419
let felts = vec![
420420
Felt252::from_hex_unchecked(BYTE_ARRAY_MAGIC),
421-
// No full word.
421+
// No full words.
422422
Felt252::from(0),
423423
// pending word: 'Hello\x11world'
424424
Felt252::from_hex_unchecked("48656c6c6f11776f726c64"),
@@ -430,7 +430,7 @@ fn test_format_for_debug() {
430430
// Valid string with a newline.
431431
let felts = vec![
432432
Felt252::from_hex_unchecked(BYTE_ARRAY_MAGIC),
433-
// No full word.
433+
// No full words.
434434
Felt252::from(0),
435435
// pending word: 'Hello\nworld'
436436
Felt252::from_hex_unchecked("48656c6c6f0a776f726c64"),

crates/cairo-lang-semantic/src/db.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ pub trait SemanticGroup: Database {
9898
module_semantic_diagnostics_tracked(self.as_dyn_database(), (), module_id)
9999
}
100100

101-
/// Aggregates file level semantic diagnostics.
101+
/// Aggregates file-level semantic diagnostics.
102102
fn file_semantic_diagnostics<'db>(
103103
&'db self,
104104
file_id: FileId<'db>,

crates/cairo-lang-starknet-classes/src/contract_segmentation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ impl FunctionInfo {
154154
Ok(())
155155
}
156156

157-
/// Visits a statement inside the function and update the [FunctionInfo] accordingly.
157+
/// Visits a statement inside the function and updates the [FunctionInfo] accordingly.
158158
fn visit_statement(
159159
&mut self,
160160
idx: usize,

crates/cairo-lang-test-runner/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ impl<'db> TestCompiler<'db> {
269269
/// # Arguments
270270
/// * `compiled` - Compiled test cases with metadata.
271271
/// * `include_ignored` - Include ignored tests as well.
272-
/// * `ignored` - Run ignored tests only.l
272+
/// * `ignored` - Run ignored tests only
273273
/// * `filter` - Include only tests containing the filter string.
274274
/// # Returns
275275
/// * (`TestCompilation`, `usize`) - The filtered test cases and the number of filtered out cases.
@@ -303,13 +303,13 @@ pub fn filter_test_cases<'db>(
303303
(tests, filtered_out)
304304
}
305305

306-
/// The status of a ran test.
306+
/// The status of a test run.
307307
enum TestStatus {
308308
Success,
309309
Fail(RunResultValue),
310310
}
311311

312-
/// The result of a ran test.
312+
/// The result of a test run.
313313
struct TestResult {
314314
/// The status of the run.
315315
status: TestStatus,
@@ -321,15 +321,15 @@ struct TestResult {
321321
profiling_info: Option<ProfilingInfo>,
322322
}
323323

324-
/// Summary data of the ran tests.
324+
/// Summary data of the tests run.
325325
pub struct TestsSummary {
326326
passed: Vec<String>,
327327
failed: Vec<String>,
328328
ignored: Vec<String>,
329329
failed_run_results: Vec<Result<RunResultValue>>,
330330
}
331331

332-
/// Runs the tests and process the results for a summary.
332+
/// Runs the tests and processes the results for a summary.
333333
pub fn run_tests(
334334
opt_db: Option<&dyn Database>,
335335
compiled: TestCompilation<'_>,

crates/cairo-lang-test-runner/src/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ fn test_format_for_panic() {
186186
];
187187
assert_eq!(format_for_panic(felts.into_iter()), "Panicked with \"Hello\\0world\".");
188188

189-
// Valid string with a non printable character.
189+
// Valid string with a non-printable character.
190190
let felts = vec![
191191
Felt252::from_hex_unchecked(BYTE_ARRAY_MAGIC),
192192
// No full word.

0 commit comments

Comments
 (0)