Skip to content

Commit

Permalink
Simplify. (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
cqc-alec authored Jul 13, 2023
1 parent 490ccb9 commit d9bc8d8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/extensions/logic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use itertools::Itertools;
use smol_str::SmolStr;

use crate::{
resource::{OpDef, ResourceSet, SignatureError},
resource::{OpDef, ResourceSet},
types::{
type_param::{TypeArg, TypeArgError, TypeParam},
SimpleType,
Expand Down Expand Up @@ -49,14 +49,14 @@ pub fn resource() -> Resource {
HashMap::default(),
|arg_values: &[TypeArg]| {
let a = arg_values.iter().exactly_one().unwrap();
let n: Result<u128, SignatureError> = match a {
TypeArg::Int(n) => Ok(*n),
let n: u128 = match a {
TypeArg::Int(n) => *n,
_ => {
return Err(TypeArgError::TypeMismatch(a.clone(), TypeParam::Int).into());
}
};
Ok((
vec![bool_type(); n.unwrap() as usize].into(),
vec![bool_type(); n as usize].into(),
vec![bool_type()].into(),
ResourceSet::default(),
))
Expand All @@ -70,14 +70,14 @@ pub fn resource() -> Resource {
HashMap::default(),
|arg_values: &[TypeArg]| {
let a = arg_values.iter().exactly_one().unwrap();
let n: Result<u128, SignatureError> = match a {
TypeArg::Int(n) => Ok(*n),
let n: u128 = match a {
TypeArg::Int(n) => *n,
_ => {
return Err(TypeArgError::TypeMismatch(a.clone(), TypeParam::Int).into());
}
};
Ok((
vec![bool_type(); n.unwrap() as usize].into(),
vec![bool_type(); n as usize].into(),
vec![bool_type()].into(),
ResourceSet::default(),
))
Expand Down

0 comments on commit d9bc8d8

Please sign in to comment.