Skip to content

cleanup of redundant patterns #6546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
replaced if guard with explicit pattern matching
  • Loading branch information
jogru0 committed Apr 23, 2025
commit 8791a38746d7b468aaa2db382d956d7e5742956c
4 changes: 2 additions & 2 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use tracing::debug;

use crate::comment::{combine_strs_with_missing_comments, contains_comment};
use crate::config::lists::*;
use crate::config::{IndentStyle, StyleEdition, TypeDensity};
use crate::config::{IndentStyle, StyleEdition, StyleEdition::*, TypeDensity};
use crate::expr::{
ExprType, RhsAssignKind, format_expr, rewrite_assign_rhs, rewrite_call, rewrite_tuple,
rewrite_unary_prefix,
Expand Down Expand Up @@ -1297,7 +1297,7 @@ fn join_bounds_inner(
// or the single item is of type `Trait`,
// and any of the internal arrays contains more than one item;
let retry_with_force_newline = match context.config.style_edition() {
style_edition if style_edition <= StyleEdition::Edition2021 => {
Edition2015 | Edition2018 | Edition2021 => {
!force_newline
&& items.len() > 1
&& (result.0.contains('\n') || result.0.len() > shape.width)
Expand Down
Loading