Skip to content

Commit c2c48e2

Browse files
committed
Improve documentation of the Density::Tall variant and remove
unnecessary condition
1 parent 0c05a21 commit c2c48e2

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/config/options.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub enum IndentStyle {
6161
pub enum Density {
6262
/// Fit as much on one line as possible.
6363
Compressed,
64-
/// Use more lines.
64+
/// Items are placed horizontally if sufficient space, vertically otherwise.
6565
Tall,
6666
/// Place every item on a separate line.
6767
Vertical,

src/lists.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,7 @@ where
246246
let total_sep_len = sep.len() * sep_count.saturating_sub(1);
247247
let real_total = total_width + total_sep_len;
248248

249-
if real_total <= limit
250-
&& !pre_line_comments
251-
&& !items.into_iter().any(|item| item.as_ref().is_multiline())
252-
{
249+
if real_total <= limit && !items.into_iter().any(|item| item.as_ref().is_multiline()) {
253250
DefinitiveListTactic::Horizontal
254251
} else {
255252
match tactic {

0 commit comments

Comments
 (0)