Skip to content

Commit d7f9b62

Browse files
authored
Fix typos in CI. (#6972)
## Description ## Checklist - [ ] I have linked to any relevant issues. - [ ] I have commented my code, particularly in hard-to-understand areas. - [ ] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [ ] If my change requires substantial documentation changes, I have [requested support from the DevRel team](https://github.com/FuelLabs/devrel-requests/issues/new/choose) - [ ] I have added tests that prove my fix is effective or that my feature works. - [ ] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [ ] I have requested a review from the relevant team or maintainers.
1 parent aa126d6 commit d7f9b62

File tree

2 files changed

+26
-18
lines changed

2 files changed

+26
-18
lines changed

.typos.toml

+8
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,12 @@ extend-ignore-identifiers-re = [
66
"tro",
77
"Tro",
88
"Nam",
9+
"typ",
10+
]
11+
12+
[files]
13+
extend-exclude = [
14+
"docs/book/theme/highlight.js",
15+
"docs/reference/theme/highlight.js",
16+
"forc-plugins/forc-doc/src/static.files/highlight.js"
917
]

sway-core/src/ir_generation/const_eval.rs

+18-18
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,13 @@ pub(crate) fn compile_constant_expression_to_constant(
250250
fn create_array_from_vec(
251251
lookup: &mut LookupEnv,
252252
elem_type: crate::TypeId,
253-
element_typs: Vec<crate::TypeId>,
253+
element_types: Vec<crate::TypeId>,
254254
element_vals: Vec<Constant>,
255255
) -> Option<Constant> {
256256
let te = lookup.engines.te();
257257
assert!({
258258
let unify_check = UnifyCheck::coercion(lookup.engines);
259-
element_typs
259+
element_types
260260
.iter()
261261
.all(|tid| unify_check.check(*tid, elem_type))
262262
});
@@ -266,7 +266,7 @@ fn create_array_from_vec(
266266
lookup.engines.de(),
267267
lookup.context,
268268
elem_type,
269-
element_typs.len().try_into().unwrap(),
269+
element_types.len().try_into().unwrap(),
270270
)
271271
.map_or(None, |array_ty| {
272272
Some(ConstantContent::new_array(
@@ -384,13 +384,13 @@ fn const_eval_typed_expr(
384384
instantiation_span,
385385
..
386386
} => {
387-
let (mut field_typs, mut field_vals): (Vec<_>, Vec<_>) = (vec![], vec![]);
387+
let (mut field_types, mut field_vals): (Vec<_>, Vec<_>) = (vec![], vec![]);
388388

389389
for field in fields {
390390
let ty::TyStructExpressionField { name: _, value, .. } = field;
391391
let eval_expr_opt = const_eval_typed_expr(lookup, known_consts, value)?;
392392
if let Some(cv) = eval_expr_opt {
393-
field_typs.push(value.return_type);
393+
field_types.push(value.return_type);
394394
field_vals.push(cv);
395395
} else {
396396
return Err(ConstEvalError::CannotBeEvaluatedToConst {
@@ -399,14 +399,14 @@ fn const_eval_typed_expr(
399399
}
400400
}
401401

402-
assert!(field_typs.len() == fields.len());
402+
assert!(field_types.len() == fields.len());
403403
assert!(field_vals.len() == fields.len());
404404

405405
get_struct_for_types(
406406
lookup.engines.te(),
407407
lookup.engines.de(),
408408
lookup.context,
409-
&field_typs,
409+
&field_types,
410410
)
411411
.map_or(None, |struct_ty| {
412412
let c = ConstantContent::new_struct(
@@ -422,12 +422,12 @@ fn const_eval_typed_expr(
422422
})
423423
}
424424
ty::TyExpressionVariant::Tuple { fields } => {
425-
let (mut field_typs, mut field_vals): (Vec<_>, Vec<_>) = (vec![], vec![]);
425+
let (mut field_types, mut field_vals): (Vec<_>, Vec<_>) = (vec![], vec![]);
426426

427427
for value in fields {
428428
let eval_expr_opt = const_eval_typed_expr(lookup, known_consts, value)?;
429429
if let Some(cv) = eval_expr_opt {
430-
field_typs.push(value.return_type);
430+
field_types.push(value.return_type);
431431
field_vals.push(cv);
432432
} else {
433433
return Err(ConstEvalError::CannotBeEvaluatedToConst {
@@ -436,14 +436,14 @@ fn const_eval_typed_expr(
436436
}
437437
}
438438

439-
assert!(field_typs.len() == fields.len());
439+
assert!(field_types.len() == fields.len());
440440
assert!(field_vals.len() == fields.len());
441441

442442
create_tuple_aggregate(
443443
lookup.engines.te(),
444444
lookup.engines.de(),
445445
lookup.context,
446-
&field_typs,
446+
&field_types,
447447
)
448448
.map_or(None, |tuple_ty| {
449449
let c = ConstantContent::new_struct(
@@ -462,12 +462,12 @@ fn const_eval_typed_expr(
462462
elem_type,
463463
contents,
464464
} => {
465-
let (mut element_typs, mut element_vals): (Vec<_>, Vec<_>) = (vec![], vec![]);
465+
let (mut element_types, mut element_vals): (Vec<_>, Vec<_>) = (vec![], vec![]);
466466

467467
for value in contents {
468468
let eval_expr_opt = const_eval_typed_expr(lookup, known_consts, value)?;
469469
if let Some(cv) = eval_expr_opt {
470-
element_typs.push(value.return_type);
470+
element_types.push(value.return_type);
471471
element_vals.push(cv);
472472
} else {
473473
return Err(ConstEvalError::CannotBeEvaluatedToConst {
@@ -476,10 +476,10 @@ fn const_eval_typed_expr(
476476
}
477477
}
478478

479-
assert!(element_typs.len() == contents.len());
479+
assert!(element_types.len() == contents.len());
480480
assert!(element_vals.len() == contents.len());
481481

482-
create_array_from_vec(lookup, *elem_type, element_typs, element_vals)
482+
create_array_from_vec(lookup, *elem_type, element_types, element_vals)
483483
}
484484
ty::TyExpressionVariant::ArrayRepeat {
485485
elem_type,
@@ -493,12 +493,12 @@ fn const_eval_typed_expr(
493493
.as_uint()
494494
.unwrap() as usize;
495495
let element_vals = (0..length).map(|_| constant).collect::<Vec<_>>();
496-
let element_typs = (0..length).map(|_| value.return_type).collect::<Vec<_>>();
496+
let element_types = (0..length).map(|_| value.return_type).collect::<Vec<_>>();
497497

498-
assert!(element_typs.len() == length);
498+
assert!(element_types.len() == length);
499499
assert!(element_vals.len() == length);
500500

501-
create_array_from_vec(lookup, *elem_type, element_typs, element_vals)
501+
create_array_from_vec(lookup, *elem_type, element_types, element_vals)
502502
}
503503
ty::TyExpressionVariant::EnumInstantiation {
504504
enum_ref,

0 commit comments

Comments
 (0)