diff options
author | Nick Fitzgerald <fitzgen@gmail.com> | 2017-09-29 15:46:44 -0700 |
---|---|---|
committer | Nick Fitzgerald <fitzgen@gmail.com> | 2017-10-02 11:32:06 -0700 |
commit | dd68ec864a00b34b614a348a91f9c5a258ca81bc (patch) | |
tree | 03962fc879110d8318c7601e17f1171212f00853 /src/codegen/mod.rs | |
parent | f5b06edf555f931bdf343cff3beb42edd9c63ba0 (diff) |
Turn `build_templated_path` into `build_path`
None of the callers were passing template parameters.
Diffstat (limited to 'src/codegen/mod.rs')
-rw-r--r-- | src/codegen/mod.rs | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs index d3a8dd40..8a200948 100644 --- a/src/codegen/mod.rs +++ b/src/codegen/mod.rs @@ -2907,7 +2907,7 @@ impl TryToRustTy for Type { { Ok(ty) } else { - utils::build_templated_path(item, ctx, vec![]) //template_params) + utils::build_path(item, ctx) } } TypeKind::Comp(ref info) => { @@ -2918,8 +2918,7 @@ impl TryToRustTy for Type { return self.try_to_opaque(ctx, item); } - // let template_params = template_params.unwrap_or(vec![]); - utils::build_templated_path(item, ctx, vec![]) + utils::build_path(item, ctx) } TypeKind::Opaque => self.try_to_opaque(ctx, item), TypeKind::BlockPointer => { @@ -3325,8 +3324,8 @@ pub fn codegen(context: &mut BindgenContext) -> Vec<quote::Tokens> { } mod utils { - use super::{ToRustTyOrOpaque, TryToRustTy, error}; - use ir::context::{BindgenContext, ItemId}; + use super::{ToRustTyOrOpaque, error}; + use ir::context::BindgenContext; use ir::function::FunctionSig; use ir::item::{Item, ItemCanonicalPath}; use ir::ty::TypeKind; @@ -3548,28 +3547,16 @@ mod utils { result.extend(old_items.into_iter()); } - pub fn build_templated_path( + pub fn build_path( item: &Item, ctx: &BindgenContext, - template_params: Vec<ItemId>, ) -> error::Result<quote::Tokens> { let path = item.namespace_aware_canonical_path(ctx); - let template_params = template_params - .iter() - .map(|param| param.try_to_rust_ty(ctx, &())) - .collect::<error::Result<Vec<_>>>()?; - let mut tokens = quote! {}; tokens.append_separated(path.into_iter().map(quote::Ident::new), "::"); - if template_params.is_empty() { - Ok(tokens) - } else { - Ok(quote! { - #tokens < #( #template_params ),* > - }) - } + Ok(tokens) } fn primitive_ty(ctx: &BindgenContext, name: &str) -> quote::Tokens { |