Skip to content

brace_style option not respected on polyadic functions with multiline signatures under "where_single_line = true" #4547

Closed
@meiomorphism

Description

@meiomorphism

Input

pub fn function_of_arity_one(
    parameter_one: Option<Option<Option<Option<Option<Option<bool>>>>>>,
) -> Option<bool> {
    None
}

pub fn function_of_arity_two(
    parameter_one: Option<Option<Option<Option<Option<Option<bool>>>>>>,
    parameter_two: Option<Option<Option<Option<Option<Option<bool>>>>>>,
) -> Option<bool> {
    None
}

pub fn function_of_arity_three(a: u8, b: u8, c: u8) -> Option<bool> {
    None
}

Output

The space after the second function's return type is converted to a newline:

pub fn function_of_arity_one(
    parameter_one: Option<Option<Option<Option<Option<Option<bool>>>>>>,
) -> Option<bool> {
    None
}

pub fn function_of_arity_two(
    parameter_one: Option<Option<Option<Option<Option<Option<bool>>>>>>,
    parameter_two: Option<Option<Option<Option<Option<Option<bool>>>>>>,
) -> Option<bool>
{
    None
}

pub fn function_of_arity_three(a: u8, b: u8, c: u8) -> Option<bool> {
    None
}

Expected output

Identical to input.

Meta

rustfmt 1.4.27-nightly (580d826 2020-11-16), installed via rustup, and invoked as cargo +nightly fmt -- ./test.rs.

rustfmt.toml contained no uncommented lines except where_single_line = true.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions