[pbs-devel] [PATCH proxmox-backup 2/4] PruneMark: implement display without the write! macro
Dominik Csapak
d.csapak at proxmox.com
Thu Oct 28 11:47:53 CEST 2021
by using write_str instead
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
pbs-datastore/src/prune.rs | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/pbs-datastore/src/prune.rs b/pbs-datastore/src/prune.rs
index c144b3db..f968e718 100644
--- a/pbs-datastore/src/prune.rs
+++ b/pbs-datastore/src/prune.rs
@@ -22,13 +22,12 @@ impl PruneMark {
impl std::fmt::Display for PruneMark {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- let txt = match self {
+ f.write_str(match self {
PruneMark::Protected => "protected",
PruneMark::Keep => "keep",
PruneMark::KeepPartial => "keep-partial",
PruneMark::Remove => "remove",
- };
- write!(f, "{}", txt)
+ })
}
}
--
2.30.2
More information about the pbs-devel
mailing list