Skip to content

Rustfmt wants to place pipe at the start of line with pattern alternative #2333

Closed
@vorner

Description

@vorner

It's probably best seen with the diff:

@@ -97,15 +92,24 @@ impl Game {
         while let Some(event) = self.events.poll_event() {
             debug!("Event: {:?}", event);
             match event {
-                Event::Quit { .. } |
-                Event::KeyDown { keycode: Some(Keycode::Q), .. } => {
+                Event::Quit { .. }
+                | Event::KeyDown {
+                    keycode: Some(Keycode::Q),
+                    ..
+                } => {
                     if !self.state.stopped() {
                         self.state.stop();
                     }
                     return Ok(TopInstruction::Quit);
-                },
-                Event::KeyUp { keycode: Some(Keycode::Space), .. } |
-                Event::KeyUp { keycode: Some(Keycode::P), .. } => self.pause_toggle()?,
+                }
+                Event::KeyUp {
+                    keycode: Some(Keycode::Space),
+                    ..
+                }
+                | Event::KeyUp {
+                    keycode: Some(Keycode::P),
+                    ..
+                } => self.pause_toggle()?,
                 _ => (),
             }
         }

I believe it's nicer to place the | at the end of the preceding line, not at the start of the new one. It seems most of the examples everywhere seem to agree with me.

No rustfmt config (eg. all defaults), version 0.3.4-nightly (6714a44 2017-12-23).

It's this repository: https://github.com/vorner/thrust.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions