use syntax::parse::token::{self, get_ident, keywords};
use syntax::owned_slice::OwnedSlice;
use syntax::visit::{self, Visitor};
-use syntax::print::pprust::{path_to_string,ty_to_string};
+use syntax::print::pprust::{path_to_string, ty_to_string};
use syntax::ptr::P;
use self::span_utils::SpanUtils;
let mut result: Vec<(Span, String)> = vec!();
-
let mut segs = vec!();
for (seg, span) in path.segments.iter().zip(spans.iter()) {
segs.push(seg.clone());
SpanUtils {
sess: sess,
err_count: Cell::new(0)
- },
- cratename.clone()),
+ }),
span: SpanUtils {
sess: sess,
err_count: Cell::new(0)
pub struct FmtStrs<'a> {
pub recorder: Box<Recorder>,
span: SpanUtils<'a>,
- krate: String,
}
macro_rules! s { ($e:expr) => { format!("{}", $e) }}
}
impl<'a> FmtStrs<'a> {
- pub fn new(rec: Box<Recorder>, span: SpanUtils<'a>, krate: String) -> FmtStrs<'a> {
+ pub fn new(rec: Box<Recorder>, span: SpanUtils<'a>) -> FmtStrs<'a> {
FmtStrs {
recorder: rec,
span: span,
- krate: krate,
}
}
});
let pairs = fields.iter().zip(values);
- let strs = pairs.map(|(f, v)| format!(",{},\"{}\"", f, escape(
- if *f == "qualname" && v.len() > 0 {
- let mut n = self.krate.clone();
- n.push_str("::");
- n.push_str(v);
- n
- } else {
- String::from_str(v)
- }
- )));
+ let strs = pairs.map(|(f, v)| format!(",{},\"{}\"", f, escape(String::from_str(v))));
Some(strs.fold(String::new(), |mut s, ss| {
s.push_str(&ss[]);
s