]> git.lizzy.rs Git - rust.git/commitdiff
Spaces around in type bounds
authorTheodore DeRego <tderego94@gmail.com>
Fri, 1 May 2015 02:52:11 +0000 (16:52 -1000)
committerTheodore DeRego <tderego94@gmail.com>
Fri, 1 May 2015 02:52:11 +0000 (16:52 -1000)
src/types.rs
tests/idem/fn.rs

index 2d1c7a3d4426854c9ea998ffd546fb2183b0fb5f..c16b9eadf4e522d97c5187de8182ee709228855c 100644 (file)
@@ -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::<Vec<_>>().connect(", "),
                             pprust::ty_to_string(bounded_ty),
-                            bounds.iter().map(|b| self.rewrite_ty_bound(b)).collect::<Vec<_>>().connect("+"))
+                            bounds.iter().map(|b| self.rewrite_ty_bound(b)).collect::<Vec<_>>().connect(" + "))
 
                 } else {
                     format!("{}: {}",
                             pprust::ty_to_string(bounded_ty),
-                            bounds.iter().map(|b| self.rewrite_ty_bound(b)).collect::<Vec<_>>().connect("+"))
+                            bounds.iter().map(|b| self.rewrite_ty_bound(b)).collect::<Vec<_>>().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::<Vec<_>>().connect("+"))
+                        bounds.iter().map(|l| pprust::lifetime_to_string(l)).collect::<Vec<_>>().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::<Vec<_>>().connect("+"))
+                lifetime.bounds.iter().map(|l| pprust::lifetime_to_string(l)).collect::<Vec<_>>().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::<Vec<_>>().connect("+"));
+            result.push_str(&ty_param.bounds.iter().map(|b| self.rewrite_ty_bound(b)).collect::<Vec<_>>().connect(" + "));
         }
         if let Some(ref def) = ty_param.default {
             result.push_str(" = ");
index a4875815e5d6332979a25bdc9f2129c7c50ae1e2..aec27597b7a15e5ca42a4850fff3e3387be686b4 100644 (file)
@@ -41,7 +41,11 @@ fn with_no_errors<T, F>(&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<()> {