From 4f7522771433e0329e76eaeec9fd0f3bfa89d2e1 Mon Sep 17 00:00:00 2001 From: Theodore DeRego Date: Thu, 30 Apr 2015 16:52:11 -1000 Subject: [PATCH] Spaces around in type bounds --- src/types.rs | 10 +++++----- tests/idem/fn.rs | 6 +++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/types.rs b/src/types.rs index 2d1c7a3d442..c16b9eadf4e 100644 --- a/src/types.rs +++ b/src/types.rs @@ -28,12 +28,12 @@ pub fn rewrite_pred(&self, predicate: &ast::WherePredicate) -> String format!("for<{}> {}: {}", bound_lifetimes.iter().map(|l| self.rewrite_lifetime_def(l)).collect::>().connect(", "), pprust::ty_to_string(bounded_ty), - bounds.iter().map(|b| self.rewrite_ty_bound(b)).collect::>().connect("+")) + bounds.iter().map(|b| self.rewrite_ty_bound(b)).collect::>().connect(" + ")) } else { format!("{}: {}", pprust::ty_to_string(bounded_ty), - bounds.iter().map(|b| self.rewrite_ty_bound(b)).collect::>().connect("+")) + bounds.iter().map(|b| self.rewrite_ty_bound(b)).collect::>().connect(" + ")) } } &ast::WherePredicate::RegionPredicate(ast::WhereRegionPredicate{ref lifetime, @@ -41,7 +41,7 @@ pub fn rewrite_pred(&self, predicate: &ast::WherePredicate) -> String ..}) => { format!("{}: {}", pprust::lifetime_to_string(lifetime), - bounds.iter().map(|l| pprust::lifetime_to_string(l)).collect::>().connect("+")) + bounds.iter().map(|l| pprust::lifetime_to_string(l)).collect::>().connect(" + ")) } &ast::WherePredicate::EqPredicate(ast::WhereEqPredicate{ref path, ref ty, ..}) => { format!("{} = {}", pprust::path_to_string(path), pprust::ty_to_string(ty)) @@ -57,7 +57,7 @@ pub fn rewrite_lifetime_def(&self, lifetime: &ast::LifetimeDef) -> String format!("{}: {}", pprust::lifetime_to_string(&lifetime.lifetime), - lifetime.bounds.iter().map(|l| pprust::lifetime_to_string(l)).collect::>().connect("+")) + lifetime.bounds.iter().map(|l| pprust::lifetime_to_string(l)).collect::>().connect(" + ")) } pub fn rewrite_ty_bound(&self, bound: &ast::TyParamBound) -> String @@ -81,7 +81,7 @@ pub fn rewrite_ty_param(&self, ty_param: &ast::TyParam) -> String result.push_str(&token::get_ident(ty_param.ident)); if ty_param.bounds.len() > 0 { result.push_str(": "); - result.push_str(&ty_param.bounds.iter().map(|b| self.rewrite_ty_bound(b)).collect::>().connect("+")); + result.push_str(&ty_param.bounds.iter().map(|b| self.rewrite_ty_bound(b)).collect::>().connect(" + ")); } if let Some(ref def) = ty_param.default { result.push_str(" = "); diff --git a/tests/idem/fn.rs b/tests/idem/fn.rs index a4875815e5d..aec27597b7a 100644 --- a/tests/idem/fn.rs +++ b/tests/idem/fn.rs @@ -41,7 +41,11 @@ fn with_no_errors(&mut self, f: F) -> T } } -pub fn render<'a, N: Clone+'a, E: Clone+'a, G: Labeller<'a, N, E>+GraphWalk<'a, N, E>, W: Write> +pub fn render<'a, + N: Clone + 'a, + E: Clone + 'a, + G: Labeller<'a, N, E> + GraphWalk<'a, N, E>, + W: Write> (g: &'a G, w: &mut W) -> io::Result<()> { -- 2.44.0