Skip to content

Commit b43eefc

Browse files
revert previous fix
1 parent 94a1c9d commit b43eefc

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/items.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2758,12 +2758,8 @@ fn rewrite_fn_base(
27582758

27592759
let ends_with_comment = last_line_contains_single_line_comment(&result);
27602760
force_new_line_for_brace |= ends_with_comment;
2761-
2762-
// PreferSameLine should keep the brace on the same line as the last where predicate.
2763-
force_new_line_for_brace |= !where_clause_str.is_empty()
2764-
&& context.config.where_single_line()
2765-
&& is_params_multi_lined
2766-
&& context.config.brace_style() != BraceStyle::PreferSameLine;
2761+
force_new_line_for_brace |=
2762+
is_params_multi_lined && context.config.where_single_line() && !where_clause_str.is_empty();
27672763

27682764
Ok((result, ends_with_comment, force_new_line_for_brace))
27692765
}

tests/target/issue-6539/prefer_same_line_where_single_line.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ fn fn_with_everything_long_and_body<T, U, 'a>(
111111
>
112112
where
113113
T: Debug + Display + Clone + Send + Sync + 'static,
114-
U: Iterator<Item = &'a T> + ExactSizeIterator, {
114+
U: Iterator<Item = &'a T> + ExactSizeIterator,
115+
{
115116
}
116117

117118
// Trait methods
@@ -216,6 +217,7 @@ pub trait Trait {
216217
>
217218
where
218219
T: Debug + Display + Clone + Send + Sync + 'static,
219-
U: Iterator<Item = &'a T> + ExactSizeIterator, {
220+
U: Iterator<Item = &'a T> + ExactSizeIterator,
221+
{
220222
}
221223
}

0 commit comments

Comments
 (0)