fn returns_bool(return_type: &ReturnType) -> bool {
    fn type_is_bool(ty: &Type) -> bool {
        matches!(ty, Type::Path(type_path) if type_path.to_token_stream().to_string() == "bool")
    }

    match return_type {
        ReturnType::Default => false,
        ReturnType::Type(_arrow, ty) => type_is_bool(ty),
    }
}
/// Returns true if the given return type is a boolean value.
///
/// Attribute macros are not able to type resolve (at least at of writing) so
/// aliases or new-types around bool will fail this check.
Returns true if the given return type is a boolean value.
Attribute macros are not able to type resolve (at least at of writing) so
aliases or new-types around bool will fail this check.
Returns true if the given return type is a boolean value . Attribute macros are not able to type resolve ( at least at of writing ) so aliases or new - types around bool will fail this check .
fn returns_bool(return_type: &ReturnType) -> bool {
    fn type_is_bool(ty: &Type) -> bool {
        matches!(ty, Type::Path(type_path) if type_path.to_token_stream().to_string() == "bool")
    }
    match return_type {
        ReturnType::Default => false,
        ReturnType::Type(_arrow, ty) => type_is_bool(ty),
    }
}
fn returns_bool ( return_type : & ReturnType ) -> bool { fn type_is_bool ( ty : & Type ) -> bool { matches ! ( ty Type Path ( type_path ) if type_path to_token_stream ( ) to_string ( ) " " ) } match return_type { ReturnType :: Default => false , ReturnType :: Type ( _arrow , ty ) => type_is_bool ( ty ) , } }
Returns true if the given return type is a boolean value.
Returns true if the given return type is a boolean value .
return_type
&ReturnType