rust-lang / rust-lang/rustfmt

Config option to remove spaces between braces and (a) their contents (b) macro names

Open
#6,152 4 comments 2 reactions 1 assignee View on GitHub

@CalebLItalien is already working on this.

Since Jul 1, 2024.

C-feature-request P-low
Dominant language
Rust
Stars
7k
Forks
1.1k
Avg merge
2d 13h
Merged PRs (30d)
24

Description

In non-Rust, I treat braces like other delimiters and don't put internal spaces adjacent to them:

function five() {return 5;}

It'd be nice if I could do this in Rust as well, partially because I'm using the json crate and I'm used to writing inline JSON spacelessly and would rather not add spaces to make it look consistent with the rest of rustfmt.

i.e. I'd prefer

object!{foo: 12}

but currently have to

object! { foo: 12 }

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.