From dc7040ddc1aca12a47d890aa346ffc7d6713b0a0 Mon Sep 17 00:00:00 2001 From: Juan Jose Nicola Date: Wed, 16 Nov 2022 11:44:00 +0100 Subject: [PATCH] Change: Improve display implementation for Catefory --- rust/nvtcache/src/nvt.rs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/rust/nvtcache/src/nvt.rs b/rust/nvtcache/src/nvt.rs index ce8784125..5c031294e 100644 --- a/rust/nvtcache/src/nvt.rs +++ b/rust/nvtcache/src/nvt.rs @@ -21,19 +21,7 @@ pub enum Category { impl fmt::Display for Category { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match self { - Category::ActInit => write!(f, "0"), - Category::ActScanner => write!(f, "1"), - Category::ActSettings => write!(f, "2"), - Category::ActGatherInfo => write!(f, "3"), - Category::ActAttack => write!(f, "4"), - Category::ActMixedAttack => write!(f, "5"), - Category::ActDestructiveAttack => write!(f, "6"), - Category::ActDenial => write!(f, "7"), - Category::ActKillHost => write!(f, "8"), - Category::ActFlood => write!(f, "9"), - Category::ActEnd => write!(f, "10"), - } + write!(f, "{}", (*self as i32).to_string()) } }