From 1d17c2129ec696d81e6c6caee8b1740dd9509090 Mon Sep 17 00:00:00 2001 From: Kevin Ballard Date: Fri, 7 Feb 2014 19:45:48 -0800 Subject: Rewrite path::Display to reduce unnecessary allocation --- src/libsyntax/parse/parser.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index aeeae94238b..93574f4d858 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -4200,10 +4200,10 @@ impl Parser { let mut err = ~"circular modules: "; let len = included_mod_stack.get().len(); for p in included_mod_stack.get().slice(i, len).iter() { - p.display().with_str(|s| err.push_str(s)); + err.push_str(p.display().as_maybe_owned().as_slice()); err.push_str(" -> "); } - path.display().with_str(|s| err.push_str(s)); + err.push_str(path.display().as_maybe_owned().as_slice()); self.span_fatal(id_sp, err); } None => () -- cgit 1.4.1-3-g733a5