Skip to content

Commit b7c5934

Browse files
committed
fmt and clippy issues
1 parent 9f38414 commit b7c5934

File tree

3 files changed

+23
-18
lines changed

3 files changed

+23
-18
lines changed

sway-core/src/language/ty/expression/expression.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -548,13 +548,11 @@ impl MaterializeConstGenerics for TyExpression {
548548
prefix.materialize_const_generics(engines, handler, name, value)?;
549549
resolved_type_of_parent.materialize_const_generics(engines, handler, name, value)
550550
}
551-
_ => {
552-
Err(handler.emit_err(
553-
sway_error::error::CompileError::ConstGenericNotSupportedHere {
554-
span: self.span.clone(),
555-
},
556-
))
557-
}
551+
_ => Err(handler.emit_err(
552+
sway_error::error::CompileError::ConstGenericNotSupportedHere {
553+
span: self.span.clone(),
554+
},
555+
)),
558556
}
559557
}
560558
}

sway-core/src/type_system/unify/unifier.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ use crate::{
1010
ast_elements::type_parameter::ConstGenericExpr,
1111
decl_engine::{DeclEngineGet, DeclId},
1212
engine_threading::{Engines, PartialEqWithEngines, PartialEqWithEnginesContext, WithEngines},
13-
language::
14-
ty::{TyEnumDecl, TyStructDecl}
15-
,
13+
language::ty::{TyEnumDecl, TyStructDecl},
1614
type_system::{engine::Unification, priv_prelude::*},
1715
};
1816

@@ -159,11 +157,15 @@ impl<'a> Unifier<'a> {
159157
(
160158
ConstGenericExpr::Literal { .. },
161159
ConstGenericExpr::AmbiguousVariableExpression { .. },
162-
) => todo!("Will be implemented by https://github.com/FuelLabs/sway/issues/6860"),
160+
) => {
161+
todo!("Will be implemented by https://github.com/FuelLabs/sway/issues/6860")
162+
}
163163
(
164164
ConstGenericExpr::AmbiguousVariableExpression { .. },
165165
ConstGenericExpr::Literal { .. },
166-
) => todo!("Will be implemented by https://github.com/FuelLabs/sway/issues/6860"),
166+
) => {
167+
todo!("Will be implemented by https://github.com/FuelLabs/sway/issues/6860")
168+
}
167169
(
168170
ConstGenericExpr::AmbiguousVariableExpression { ident: r_ident },
169171
ConstGenericExpr::AmbiguousVariableExpression { ident: e_ident },

sway-core/src/type_system/unify/unify_check.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -812,13 +812,18 @@ impl<'a> UnifyCheck<'a> {
812812
}
813813
(TypeParameter::Const(l), TypeParameter::Const(r)) => {
814814
match (l.expr.as_ref(), r.expr.as_ref()) {
815-
(None, None) => {},
816-
(None, Some(_)) => {},
817-
(Some(_), None) => {},
818-
(Some(ConstGenericExpr::Literal { val: l_val, .. }), Some(ConstGenericExpr::Literal { val: r_val, .. })) => {
815+
(None, None) => {}
816+
(None, Some(_)) => {}
817+
(Some(_), None) => {}
818+
(
819+
Some(ConstGenericExpr::Literal { val: l_val, .. }),
820+
Some(ConstGenericExpr::Literal { val: r_val, .. }),
821+
) => {
819822
assert!(l_val == r_val);
820-
},
821-
(Some(_), Some(_)) => todo!("Will be implemented by https://github.com/FuelLabs/sway/issues/6860"),
823+
}
824+
(Some(_), Some(_)) => todo!(
825+
"Will be implemented by https://github.com/FuelLabs/sway/issues/6860"
826+
),
822827
}
823828
}
824829
_ => return false,

0 commit comments

Comments
 (0)