address review comments
This commit is contained in:
parent
57afbb0a57
commit
805b4290ef
2 changed files with 7 additions and 9 deletions
|
@ -28,11 +28,9 @@ pub struct Flattener<'ast, T: Field> {
|
||||||
|
|
||||||
// We introduce a trait in order to make it possible to make flattening `e` generic over the type of `e`
|
// We introduce a trait in order to make it possible to make flattening `e` generic over the type of `e`
|
||||||
|
|
||||||
#[rustfmt::skip]
|
trait Flatten<'ast, T: Field>:
|
||||||
trait Flatten<'ast, T: Field>
|
TryFrom<TypedExpression<'ast, T>, Error = ()> + IfElse<'ast, T> + Select<'ast, T>
|
||||||
: TryFrom<TypedExpression<'ast, T>, Error: std::fmt::Debug>
|
{
|
||||||
+ IfElse<'ast, T>
|
|
||||||
+ Select<'ast, T> {
|
|
||||||
fn flatten(
|
fn flatten(
|
||||||
self,
|
self,
|
||||||
flattener: &mut Flattener<'ast, T>,
|
flattener: &mut Flattener<'ast, T>,
|
||||||
|
@ -196,11 +194,11 @@ impl<'ast, T: Field> Flattener<'ast, T> {
|
||||||
res.into_iter().map(|r| r.into()).collect()
|
res.into_iter().map(|r| r.into()).collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Flatten a array selection expression
|
/// Flatten an array selection expression
|
||||||
///
|
///
|
||||||
/// # Arguments
|
/// # Arguments
|
||||||
///
|
///
|
||||||
/// * `symbols` - Available functions in in this context
|
/// * `symbols` - Available functions in this context
|
||||||
/// * `statements_flattened` - Vector where new flattened statements can be added.
|
/// * `statements_flattened` - Vector where new flattened statements can be added.
|
||||||
/// * `expression` - `TypedExpression` that will be flattened.
|
/// * `expression` - `TypedExpression` that will be flattened.
|
||||||
/// # Remarks
|
/// # Remarks
|
||||||
|
@ -1054,7 +1052,7 @@ impl<'ast, T: Field> Flattener<'ast, T> {
|
||||||
///
|
///
|
||||||
/// * `symbols` - Available functions in in this context
|
/// * `symbols` - Available functions in in this context
|
||||||
/// * `statements_flattened` - Vector where new flattened statements can be added.
|
/// * `statements_flattened` - Vector where new flattened statements can be added.
|
||||||
/// * `expression` - `ArrayExpression` that will be flattened.
|
/// * `expr` - `ArrayExpression` that will be flattened.
|
||||||
/// # Remarks
|
/// # Remarks
|
||||||
/// * U is the inner type of the array
|
/// * U is the inner type of the array
|
||||||
fn flatten_array_expression<U: Flatten<'ast, T>>(
|
fn flatten_array_expression<U: Flatten<'ast, T>>(
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#![feature(box_patterns, box_syntax, associated_type_bounds)]
|
#![feature(box_patterns, box_syntax)]
|
||||||
|
|
||||||
extern crate num;
|
extern crate num;
|
||||||
extern crate num_bigint;
|
extern crate num_bigint;
|
||||||
|
|
Loading…
Reference in a new issue