fn accumulate_static_time<F>(
    st: &StructureGraph,
    stmts: &[Control],
    acc: F,
) -> Option<u64>
where
    F: FnMut(u64, &u64) -> u64,
{
    let timing: Result<Vec<&u64>, ()> = stmts
        .iter()
        .map(|con| {
            if let Control::Enable {
                data: Enable { comp: group },
            } = con
            {
                st.groups[&Some(group.clone())]
                    .0
                    .get("static")
                    .ok_or_else(|| ())
            } else {
                Err(())
            }
        })
        .collect();

    timing.ok().map(|ts| ts.into_iter().fold(0, acc))
}
/// Function to iterate over a vector of control statements and collect
/// the "static" attribute using the `acc` function.
/// Returns None if any of of the Control statements is a compound statement.
Function to iterate over a vector of control statements and collect
the "static" attribute using the `acc` function.
Returns None if any of of the Control statements is a compound statement.
Function to iterate over a vector of control statements and collect the " static " attribute using the ` acc ` function . Returns None if any of of the Control statements is a compound statement .
fn accumulate_static_time<F>(
    st: &StructureGraph,
    stmts: &[Control],
    acc: F,
) -> Option<u64>
where
    F: FnMut(u64, &u64) -> u64,
{
    let timing: Result<Vec<&u64>, ()> = stmts
        .iter()
        .map(|con| {
            if let Control::Enable {
                data: Enable { comp: group },
            } = con
            {
                st.groups[&Some(group.clone())]
                    .0
                    .get("static")
                    .ok_or_else(|| ())
            } else {
                Err(())
            }
        })
        .collect();
    timing.ok().map(|ts| ts.into_iter().fold(0, acc))
}
fn accumulate_static_time < F > ( st : & StructureGraph , stmts : & [ Control ] , acc : F , ) -> Option < u64 > where F : FnMut ( u64 , & u64 ) -> u64 , { let timing : Result < Vec < & u64 > , ( ) > = stmts . iter ( ) . map ( | con | { if let Control :: Enable { data : Enable { comp : group } , } = con { st . groups [ & Some ( group . clone ( ) ) ] . 0 . get ( " " ) . ok_or_else ( | | ( ) ) } else { Err ( ( ) ) } } ) . collect ( ) ; timing . ok ( ) . map ( | ts | ts . into_iter ( ) . fold ( 0 , acc ) ) }
Function to iterate over a vector of control statements and collect
the "static" attribute using the `acc` function.
Function to iterate over a vector of control statements and collect the " static " attribute using the ` acc ` function .
st
&StructureGraph
stmts
&[Control]
acc
F