rusty-diceware

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit f6a14f426193273874555b5718a23ca8d5804ecb
parent 047f815113c701f1c92edecbee2dbc24f36cbbde
Author: Yuval Langer <yuval.langer@gmail.com>
Date:   Sun, 12 May 2019 17:09:48 +0300

Replace misuse of the `match` expression with `let` deconstructing assignment.

Diffstat:
Msrc/diceware.rs | 15++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/diceware.rs b/src/diceware.rs @@ -74,9 +74,8 @@ impl rand::Rand for BealeWord { impl fmt::Display for BealeWord { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match self { - &BealeWord(w) => write!(f, "{}", w), - } + let BealeWord(w) = self; + write!(f, "{}", w) } } @@ -96,9 +95,8 @@ impl rand::Rand for ReinholdWord { impl fmt::Display for ReinholdWord { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match self { - &ReinholdWord(w) => write!(f, "{}", w), - } + let ReinholdWord(w) = self; + write!(f, "{}", w) } } @@ -118,8 +116,7 @@ impl rand::Rand for MiniLockWord { impl fmt::Display for MiniLockWord { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match self { - &MiniLockWord(w) => write!(f, "{}", w), - } + let MiniLockWord(w) = self; + write!(f, "{}", w) } }