Merge pull request #2128 from topecongiro/issue-2125
Wrap long single field tuple struct
This commit is contained in:
commit
0c250d0e5d
15
src/items.rs
15
src/items.rs
@ -1281,17 +1281,10 @@ fn format_tuple_struct(
|
||||
}
|
||||
result.push(')');
|
||||
} else {
|
||||
// 1 = ","
|
||||
let body = rewrite_call_inner(
|
||||
context,
|
||||
"",
|
||||
&fields.iter().map(|field| field).collect::<Vec<_>>()[..],
|
||||
span,
|
||||
Shape::indented(offset, context.config).sub_width(1)?,
|
||||
context.config.fn_call_width(),
|
||||
false,
|
||||
)?;
|
||||
result.push_str(&body);
|
||||
let shape = Shape::indented(offset, context.config);
|
||||
let fields = &fields.iter().map(|field| field).collect::<Vec<_>>()[..];
|
||||
let one_line_width = context.config.fn_call_width();
|
||||
result = rewrite_call_inner(context, &result, fields, span, shape, one_line_width, false)?;
|
||||
}
|
||||
|
||||
if !where_clause_str.is_empty() && !where_clause_str.contains('\n')
|
||||
|
@ -266,3 +266,6 @@ pub(crate) struct Foo{}
|
||||
pub(in self) struct Foo();
|
||||
pub(super) struct Foo();
|
||||
pub(crate) struct Foo();
|
||||
|
||||
// #2125
|
||||
pub struct ReadinessCheckRegistry(Mutex<HashMap<Arc<String>, Box<Fn() -> ReadinessCheck + Sync + Send>>>);
|
||||
|
@ -308,3 +308,8 @@ pub(crate) struct Foo {}
|
||||
pub(self) struct Foo();
|
||||
pub(super) struct Foo();
|
||||
pub(crate) struct Foo();
|
||||
|
||||
// #2125
|
||||
pub struct ReadinessCheckRegistry(
|
||||
Mutex<HashMap<Arc<String>, Box<Fn() -> ReadinessCheck + Sync + Send>>>,
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user