diff --git a/ipc/codegen/src/codegen.rs b/ipc/codegen/src/codegen.rs index ebd2bb361..85ea86f16 100644 --- a/ipc/codegen/src/codegen.rs +++ b/ipc/codegen/src/codegen.rs @@ -702,9 +702,10 @@ fn implement_interface( } let all_tys = collect_tys( - cx, - builder, - &method_signatures.iter().map(|&(_, signature)| signature).collect::>()); + &method_signatures + .iter() + .map(|&(_, signature)| signature) + .collect::>()); let replacements = typegen::match_unknown_tys(cx, builder, &all_tys, push); diff --git a/ipc/codegen/src/typegen.rs b/ipc/codegen/src/typegen.rs index e339b6788..6e09c9fe6 100644 --- a/ipc/codegen/src/typegen.rs +++ b/ipc/codegen/src/typegen.rs @@ -23,7 +23,6 @@ use syntax::ast::{ }; use syntax::ast; -use syntax::codemap::Span; use syntax::ext::base::{Annotatable, ExtCtxt}; use syntax::ext::build::AstBuilder; use syntax::ptr::P; @@ -31,13 +30,12 @@ use syntax::ptr::P; use std::collections::{HashMap, HashSet}; use std::ops::Deref; -fn is_new_entry(builder: &aster::AstBuilder, path: &Path) -> Option { +fn is_new_entry(path: &Path) -> Option { let known = { if path.segments.len() > 1 { false } else { let ident = format!("{}", path.segments[0].identifier.name.as_str()); - ident == "u32" || ident == "u64" || ident == "usize" || @@ -52,14 +50,6 @@ fn is_new_entry(builder: &aster::AstBuilder, path: &Path) -> Option { else { Some(::syntax::print::pprust::path_to_string(path)) } } -fn path_str(path: &Path) -> String { - let mut res: String = "_".to_owned(); - for segment in path.segments.iter() { - res.push_str(&format!("{}_", segment.identifier.name.as_str())); - } - res -} - pub fn argument_replacement( builder: &aster::AstBuilder, replacements: &HashMap>, @@ -219,7 +209,7 @@ pub fn match_unknown_tys( continue; } - match is_new_entry(builder, path) { + match is_new_entry(path) { Some(old_path) => { if hash_map.get(&old_path).is_some() { continue;