Skip to content

Double indent in match expression #1004

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nrc opened this issue May 26, 2016 · 4 comments
Closed

Double indent in match expression #1004

nrc opened this issue May 26, 2016 · 4 comments
Assignees

Comments

@nrc
Copy link
Member

nrc commented May 26, 2016

         match *self {
-            ty::ImplOrTraitItem::MethodTraitItem(ref i) => write!(f, "{:?}", i),
-            ty::ImplOrTraitItem::ConstTraitItem(ref i) => write!(f, "{:?}", i),
-            ty::ImplOrTraitItem::TypeTraitItem(ref i) => write!(f, "{:?}", i),
-        }?;
+                ty::ImplOrTraitItem::MethodTraitItem(ref i) => write!(f, "{:?}", i),
+                ty::ImplOrTraitItem::ConstTraitItem(ref i) => write!(f, "{:?}", i),
+                ty::ImplOrTraitItem::TypeTraitItem(ref i) => write!(f, "{:?}", i),
+            }
+            ?;
@nrc nrc added this to the 1.0 milestone May 26, 2016
@nrc
Copy link
Member Author

nrc commented May 26, 2016

Also in cloures outside of a method chain. I wonder if the ? is significant or not?

         ty::tls::with(|tcx| {
-            let principal = tcx.lift(&self.principal.0)
-                               .expect("could not lift TraitRef for printing");
-            let projections = tcx.lift(&bounds.projection_bounds[..])
-                                 .expect("could not lift projections for printing");
-            let projections = projections.into_iter().map(|p| p.0).collect();
+                let principal = tcx.lift(&self.principal.0)
+                    .expect("could not lift TraitRef for printing");
+                let projections = tcx.lift(&bounds.projection_bounds[..])
+                    .expect("could not lift projections for printing");
+                let projections = projections.into_iter().map(|p| p.0).collect();

-            let tap = ty::Binder(TraitAndProjections(principal, projections));
-            in_binder(f, tcx, &ty::Binder(""), Some(tap))
-        })?;
+                let tap = ty::Binder(TraitAndProjections(principal, projections));
+                in_binder(f, tcx, &ty::Binder(""), Some(tap))
+            })
+            ?;

@nrc
Copy link
Member Author

nrc commented May 26, 2016

Also seems to happen when the match is on the rhs of a let statement.

@nrc
Copy link
Member Author

nrc commented May 28, 2016

Yes, the ? is significant

@nrc nrc self-assigned this May 28, 2016
@nrc
Copy link
Member Author

nrc commented May 28, 2016

I have a fix, but I'm too tired to write a test tonight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant