cosmetic changes
This commit is contained in:
parent
1e1e567435
commit
987b84c530
@ -702,9 +702,10 @@ fn implement_interface(
|
|||||||
}
|
}
|
||||||
|
|
||||||
let all_tys = collect_tys(
|
let all_tys = collect_tys(
|
||||||
cx,
|
&method_signatures
|
||||||
builder,
|
.iter()
|
||||||
&method_signatures.iter().map(|&(_, signature)| signature).collect::<Vec<&MethodSig>>());
|
.map(|&(_, signature)| signature)
|
||||||
|
.collect::<Vec<&MethodSig>>());
|
||||||
|
|
||||||
let replacements = typegen::match_unknown_tys(cx, builder, &all_tys, push);
|
let replacements = typegen::match_unknown_tys(cx, builder, &all_tys, push);
|
||||||
|
|
||||||
|
@ -23,7 +23,6 @@ use syntax::ast::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use syntax::ast;
|
use syntax::ast;
|
||||||
use syntax::codemap::Span;
|
|
||||||
use syntax::ext::base::{Annotatable, ExtCtxt};
|
use syntax::ext::base::{Annotatable, ExtCtxt};
|
||||||
use syntax::ext::build::AstBuilder;
|
use syntax::ext::build::AstBuilder;
|
||||||
use syntax::ptr::P;
|
use syntax::ptr::P;
|
||||||
@ -31,13 +30,12 @@ use syntax::ptr::P;
|
|||||||
use std::collections::{HashMap, HashSet};
|
use std::collections::{HashMap, HashSet};
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
|
|
||||||
fn is_new_entry(builder: &aster::AstBuilder, path: &Path) -> Option<String> {
|
fn is_new_entry(path: &Path) -> Option<String> {
|
||||||
let known = {
|
let known = {
|
||||||
if path.segments.len() > 1 {
|
if path.segments.len() > 1 {
|
||||||
false
|
false
|
||||||
} else {
|
} else {
|
||||||
let ident = format!("{}", path.segments[0].identifier.name.as_str());
|
let ident = format!("{}", path.segments[0].identifier.name.as_str());
|
||||||
|
|
||||||
ident == "u32" ||
|
ident == "u32" ||
|
||||||
ident == "u64" ||
|
ident == "u64" ||
|
||||||
ident == "usize" ||
|
ident == "usize" ||
|
||||||
@ -52,14 +50,6 @@ fn is_new_entry(builder: &aster::AstBuilder, path: &Path) -> Option<String> {
|
|||||||
else { Some(::syntax::print::pprust::path_to_string(path)) }
|
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(
|
pub fn argument_replacement(
|
||||||
builder: &aster::AstBuilder,
|
builder: &aster::AstBuilder,
|
||||||
replacements: &HashMap<String, P<Ty>>,
|
replacements: &HashMap<String, P<Ty>>,
|
||||||
@ -219,7 +209,7 @@ pub fn match_unknown_tys(
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
match is_new_entry(builder, path) {
|
match is_new_entry(path) {
|
||||||
Some(old_path) => {
|
Some(old_path) => {
|
||||||
if hash_map.get(&old_path).is_some() {
|
if hash_map.get(&old_path).is_some() {
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user