Skip to content
This repository has been archived by the owner on Aug 12, 2023. It is now read-only.

fix(rustfmt): remove edition in default arguments #473

Merged
merged 3 commits into from
Dec 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion doc/BUILTINS.md
Original file line number Diff line number Diff line change
Expand Up @@ -1216,6 +1216,11 @@ local sources = { null_ls.builtins.formatting.rufo }

A tool for formatting `rust` code according to style guidelines.

- `--edition` defaults to `2015`. To set a different edition, use `extra_args`.
- See [the
wiki](https://github.com/jose-elias-alvarez/null-ls.nvim/wiki/Source-specific-Configuration#rustfmt)
for other workarounds.

##### Usage

```lua
Expand All @@ -1226,7 +1231,7 @@ local sources = { null_ls.builtins.formatting.rustfmt }

- `filetypes = { "rust" }`
- `command = "rustfmt"`
- `args = { "--emit=stdout", "--edition=2018" }`
- `args = { "--emit=stdout" }`

#### [rustywind](https://github.com/avencera/rustywind)

Expand Down
2 changes: 1 addition & 1 deletion lua/null-ls/builtins/formatting/rustfmt.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ return h.make_builtin({
filetypes = { "rust" },
generator_opts = {
command = "rustfmt",
args = { "--emit=stdout", "--edition=2018" },
args = { "--emit=stdout" },
to_stdin = true,
},
factory = h.formatter_factory,
Expand Down