Skip wrapping if function returns Dynamicc.

This commit is contained in:
Stephen Chung
2020-10-15 13:28:22 +08:00
parent 707ece7e80
commit 3c9250b0bf
6 changed files with 119 additions and 65 deletions

View File

@@ -3,6 +3,7 @@ use std::collections::HashMap;
use quote::{quote, ToTokens};
use crate::attrs::ExportScope;
use crate::function::flatten_type_groups;
use crate::function::{ExportedFn, FnSpecialAccess};
use crate::module::Module;
@@ -174,14 +175,6 @@ pub(crate) fn generate_body(
}
}
pub(crate) fn flatten_type_groups(ty: &syn::Type) -> &syn::Type {
match ty {
syn::Type::Group(syn::TypeGroup { ref elem, .. })
| syn::Type::Paren(syn::TypeParen { ref elem, .. }) => flatten_type_groups(elem.as_ref()),
_ => ty,
}
}
pub(crate) fn check_rename_collisions(fns: &Vec<ExportedFn>) -> Result<(), syn::Error> {
fn make_key(name: impl ToString, itemfn: &ExportedFn) -> String {
itemfn