fn check_fn_arg_type(pos: usize, input: &PatType) {
    if let Type::Reference(ref reference) = *input.ty {
        if let Some(ref lifetime) = reference.lifetime {
            abort!(
                lifetime.span(), "No reference lifetime allowed";
                help = "References inside Hive testfunction arguments do not need any lifetime specification.";
                example = "example: {}", FUNCTION_EXAMPLE
            );
        }

        if reference.mutability.is_none() {
            abort!(
                reference.span(), "Function arguments should be mutable";
                help = "All arguments in a Hive testfunction are mutable references.";
                example = "example: {}", FUNCTION_EXAMPLE
            );
        }

        if let Type::Path(ref path) = *reference.elem {
            if !path.path.is_ident(TESTFUNCTION_ARGUMENT_TYPE[pos]) {
                abort!(
                    path.path.span(), "Wrong function argument type";
                    help = "Only the argument types listed in the example below are valid types to use in a Hive testfunction.";
                    example = "example: {}", FUNCTION_EXAMPLE
                );
            }
        }
    } else {
        abort!(
            input.ty.span(), "Function arguments should be accessed by reference";
            help = "All arguments in a Hive testfunction are accessed by reference and not by type.";
            example = "example: {}", FUNCTION_EXAMPLE
        );
    }
}
/// Checks the provided function argument types against the given types in [`TESTFUNCTION_ARGUMENT_TYPE`]
Checks the provided function argument types against the given types in [`TESTFUNCTION_ARGUMENT_TYPE`]
Checks the provided function argument types against the given types in [ ` TESTFUNCTION_ARGUMENT_TYPE ` ]
fn check_fn_arg_type(pos: usize, input: &PatType) {
    if let Type::Reference(ref reference) = *input.ty {
        if let Some(ref lifetime) = reference.lifetime {
            abort!(
                lifetime.span(), "No reference lifetime allowed";
                help = "References inside Hive testfunction arguments do not need any lifetime specification.";
                example = "example: {}", FUNCTION_EXAMPLE
            );
        }
        if reference.mutability.is_none() {
            abort!(
                reference.span(), "Function arguments should be mutable";
                help = "All arguments in a Hive testfunction are mutable references.";
                example = "example: {}", FUNCTION_EXAMPLE
            );
        }
        if let Type::Path(ref path) = *reference.elem {
            if !path.path.is_ident(TESTFUNCTION_ARGUMENT_TYPE[pos]) {
                abort!(
                    path.path.span(), "Wrong function argument type";
                    help = "Only the argument types listed in the example below are valid types to use in a Hive testfunction.";
                    example = "example: {}", FUNCTION_EXAMPLE
                );
            }
        }
    } else {
        abort!(
            input.ty.span(), "Function arguments should be accessed by reference";
            help = "All arguments in a Hive testfunction are accessed by reference and not by type.";
            example = "example: {}", FUNCTION_EXAMPLE
        );
    }
}
fn check_fn_arg_type ( pos : usize , input : & PatType ) { if let Type :: Reference ( ref reference ) = * input . ty { if let Some ( ref lifetime ) = reference . lifetime { abort ! ( lifetime span ( ) " " help " " example " " FUNCTION_EXAMPLE ) ; } if reference . mutability . is_none ( ) { abort ! ( reference span ( ) " " help " " example " " FUNCTION_EXAMPLE ) ; } if let Type :: Path ( ref path ) = * reference . elem { if ! path . path . is_ident ( TESTFUNCTION_ARGUMENT_TYPE [ pos ] ) { abort ! ( path path span ( ) " " help " " example " " FUNCTION_EXAMPLE ) ; } } } else { abort ! ( input ty span ( ) " " help " " example " " FUNCTION_EXAMPLE ) ; } }
Checks the provided function argument types against the given types in [`TESTFUNCTION_ARGUMENT_TYPE`]
Checks the provided function argument types against the given types in [ ` TESTFUNCTION_ARGUMENT_TYPE ` ]
pos
usize
input
&PatType