PruneMark: implement display without the write! macro

by using write_str instead

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Dominik Csapak 2021-10-28 11:47:53 +02:00 committed by Wolfgang Bumiller
parent d4e9d5470e
commit 342ed4aea0
1 changed files with 2 additions and 3 deletions

View File

@ -22,13 +22,12 @@ impl PruneMark {
impl std::fmt::Display for PruneMark { impl std::fmt::Display for PruneMark {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let txt = match self { f.write_str(match self {
PruneMark::Protected => "protected", PruneMark::Protected => "protected",
PruneMark::Keep => "keep", PruneMark::Keep => "keep",
PruneMark::KeepPartial => "keep-partial", PruneMark::KeepPartial => "keep-partial",
PruneMark::Remove => "remove", PruneMark::Remove => "remove",
}; })
write!(f, "{}", txt)
} }
} }