rust-lang / rust-lang/rustfmt

Rustfmt sometimes puts 2 args in one line, but the rest on separate lines

Open
#4,301 1 comment 0 reactions 1 assignee View on GitHub

@topecongiro is already working on this.

Since Jul 1, 2020.

I-poor-formatting
Dominant language
Rust
Stars
7k
Forks
1.1k
Avg merge
2d 13h
Merged PRs (30d)
24

Description

rustfmt 1.4.18-nightly (c1e9b7b8 2020-06-13)

When I run rustfmt on this, it stays like this:

	self.renderer.render(
		texture,
		identity, // model
		identity, // perspective
		identity, // view
		None,     // alpha
		false,    // depth_test
		&mut target,
	);

But when I remove &mut before target:

	self.renderer.render(
		texture,
		identity, // model
		identity, // perspective
		identity, // view
		None,     // alpha
		false,    // depth_test
		target,
	);

rustfmt formats it like this:

	self.renderer.render(
		texture, identity, // model
		identity, // perspective
		identity, // view
		None,     // alpha
		false,    // depth_test
		target,
	);

Note: texture, identity, // model in one line.
:(

Expected output

	self.renderer.render(
		texture,
		identity, // model
		identity, // perspective
		identity, // view
		None,     // alpha
		false,    // depth_test
		target,
	);

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.