diff options
author | David Gay <eapoems@riseup.net> | 2023-09-30 22:20:08 -0400 |
---|---|---|
committer | David Gay <eapoems@riseup.net> | 2023-09-30 22:20:08 -0400 |
commit | f92a67d5d0010a1c9825acd7b6ec87580b429272 (patch) | |
tree | c050449b018e92e47e7ac3fcb26625c2eec7342f | |
parent | 63a2e051997f38fe615e4f2eb0775f9e6cdfb994 (diff) |
Update RollResult display so it shows individual roll faces too
-rw-r--r-- | src/dice.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/dice.rs b/src/dice.rs index 1293a6f..ffec3b8 100644 --- a/src/dice.rs +++ b/src/dice.rs @@ -38,7 +38,10 @@ impl RollResult { impl fmt::Display for RollResult { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - write!(f, "{}", self.total()) + write!(f, "{} ({})", self.total(), self.rolls.iter() + .map(|dr| dr.face.to_string()) + .collect::<Vec<String>>() + .join(", ")) } } |