/// Tries to match as many of the expected_args as possible based on the given type_id
/// Returns false if this does not exhaust the iterator
Tries to match as many of the expected_args as possible based on the given type_id
Returns false if this does not exhaust the iterator
Tries to match as many of the expected_args as possible based on the given type_id Returns false if this does not exhaust the iterator
fn matches_variadic(type_id: TypeId, expected_args: &mut Peekable<Iter<FuncArgType>>) -> bool {
    while let Some(&&FuncArgType::Arg(arg_id)) = expected_args.peek() {
        if arg_id == type_id {
            expected_args.next();
        }
        else {
            return false;
        }
    }
    // If the iterator is not exhausted, it means we hit something we did not expect
    expected_args.peek().is_none()
}
fn matches_variadic ( type_id : TypeId , expected_args : & mut Peekable < Iter < FuncArgType > > ) -> bool { while let Some ( & & FuncArgType :: Arg ( arg_id ) ) = expected_args . peek ( ) { if arg_id == type_id { expected_args . next ( ) ; } else { return false ; } } // If the iterator is not exhausted, it means we hit something we did not expect expected_args . peek ( ) . is_none ( ) }
Tries to match as many of the expected_args as possible based on the given type_id
Returns false if this does not exhaust the iterator
Tries to match as many of the expected_args as possible based on the given type_id Returns false if this does not exhaust the iterator
type_id
TypeId
expected_args
&mut Peekable<Iter<FuncArgType>>