Switch to into_iter instead of a non-consuming iterator.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
f355fad06b
commit
eb42704380
|
@ -163,14 +163,14 @@ const MAX_DISPLAYED_ROLLS: usize = 15;
|
||||||
fn fmt_rolls(pool: &DicePoolRoll) -> String {
|
fn fmt_rolls(pool: &DicePoolRoll) -> String {
|
||||||
let rolls = pool.rolls();
|
let rolls = pool.rolls();
|
||||||
if rolls.len() > MAX_DISPLAYED_ROLLS {
|
if rolls.len() > MAX_DISPLAYED_ROLLS {
|
||||||
let shown_amount = rolls.iter().take(MAX_DISPLAYED_ROLLS).join(", ");
|
let shown_amount = rolls.into_iter().take(MAX_DISPLAYED_ROLLS).join(", ");
|
||||||
format!(
|
format!(
|
||||||
"{}, and {} more",
|
"{}, and {} more",
|
||||||
shown_amount,
|
shown_amount,
|
||||||
rolls.len() - MAX_DISPLAYED_ROLLS
|
rolls.len() - MAX_DISPLAYED_ROLLS
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
rolls.iter().join(", ")
|
rolls.into_iter().join(", ")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue