From e6938806fc99fa7615a2b5575f36d34caa413fbe Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Tue, 24 Mar 2026 12:23:59 +0300 Subject: [PATCH] Remove hard coded edition default Hard coding a default fallback creates a problem for many use cases. Short of creating an unwanted config file in projects I don't have a say in, I can't make it stop reformatting files with the wrong edition. Furthermore this makes it impossible for users to set their own default fallback via the g:rustfmt_options setting because it will not accept the edition argument being specified more than once. The upstream rustfmt binary has its own fallback logic, by default we should just let it use it. --- autoload/rustfmt.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/rustfmt.vim b/autoload/rustfmt.vim index 59a58e84..c77cd6f4 100644 --- a/autoload/rustfmt.vim +++ b/autoload/rustfmt.vim @@ -71,8 +71,8 @@ function! s:RustfmtConfigOptions() return '--config-path '.shellescape(fnamemodify(l:_rustfmt_toml, ":p")) endif - " Default to edition 2018 in case no rustfmt.toml was found. - return '--edition 2018' + " Let rustfmt use its own defaults in the absense of a config + return '' endfunction function! s:RustfmtCommandRange(filename, line1, line2)