Skip to content

rustfmt does not respect brace_style when formatting imports #5545

Open
@BenjaminBrienen

Description

@BenjaminBrienen

With:

hard_tabs = true
braces_style = "AlwaysNextLine"
control_brace_style = "AlwaysNextLine"
group_imports = "StdExternalCrate"
imports_granularity = "One"
imports_indent = "Block"
imports_layout = "Vertical"
indent_style = "Block"
newline_style = "Unix"
trailing_comma = "Vertical"

Current output:

use {
	colored::{
		ColoredString,
		Colorize,
	},
	std::{
		cmp::Ordering,
		fmt::{
			Display,
			Formatter,
		},
		io::{
			Read,
			Write,
		},
		ops::{
			ControlFlow,
			RangeInclusive,
		},
		result::Result,
	},
};

Expected output:

use
{
	colored::
	{
		ColoredString,
		Colorize,
	},
	std::
	{
		cmp::Ordering,
		fmt::
		{
			Display,
			Formatter,
		},
		io::
		{
			Read,
			Write,
		},
		ops::
		{
			ControlFlow,
			RangeInclusive,
		},
		result::Result,
	},
};

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions