11
11
/// Each filter stage returns a set of actions and a set of terminal actions.
12
12
/// The terminal actions are the subset of actions that are maintained through
13
13
/// the next filter stage.
14
+ use std:: fmt;
14
15
use bitmask_enum:: bitmask;
15
16
16
17
#[ bitmask]
@@ -280,7 +281,6 @@ use proc_macro2::{Ident, Span};
280
281
use quote:: { quote, ToTokens } ;
281
282
use std:: str:: FromStr ;
282
283
283
- #[ allow( clippy:: to_string_trait_impl) ]
284
284
impl FromStr for ActionData {
285
285
type Err = core:: fmt:: Error ;
286
286
fn from_str ( s : & str ) -> Result < Self , Self :: Err > {
@@ -301,23 +301,23 @@ impl FromStr for ActionData {
301
301
}
302
302
}
303
303
304
- #[ allow( clippy:: to_string_trait_impl) ]
305
- impl ToString for ActionData {
306
- fn to_string ( & self ) -> String {
307
- match * self {
308
- ActionData :: PacketContinue => "PacketContinue" . into ( ) ,
309
- ActionData :: PacketDeliver => "PacketDeliver" . into ( ) ,
310
- ActionData :: ProtoProbe => "ProtoProbe" . into ( ) ,
311
- ActionData :: ProtoFilter => "ProtoFilter" . into ( ) ,
312
- ActionData :: SessionFilter => "SessionFilter" . into ( ) ,
313
- ActionData :: SessionDeliver => "SessionDeliver" . into ( ) ,
314
- ActionData :: SessionTrack => "SessionTrack" . into ( ) ,
315
- ActionData :: UpdatePDU => "UpdatePDU" . into ( ) ,
316
- ActionData :: ReassembledUpdatePDU => "ReassembledUpdatePDU" . into ( ) ,
317
- ActionData :: PacketTrack => "PacketTrack" . into ( ) ,
318
- ActionData :: ConnDeliver => "ConnDeliver" . into ( ) ,
304
+ impl fmt:: Display for ActionData {
305
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
306
+ let s = match * self {
307
+ ActionData :: PacketContinue => "PacketContinue" ,
308
+ ActionData :: PacketDeliver => "PacketDeliver" ,
309
+ ActionData :: ProtoProbe => "ProtoProbe" ,
310
+ ActionData :: ProtoFilter => "ProtoFilter" ,
311
+ ActionData :: SessionFilter => "SessionFilter" ,
312
+ ActionData :: SessionDeliver => "SessionDeliver" ,
313
+ ActionData :: SessionTrack => "SessionTrack" ,
314
+ ActionData :: UpdatePDU => "UpdatePDU" ,
315
+ ActionData :: ReassembledUpdatePDU => "ReassembledUpdatePDU" ,
316
+ ActionData :: PacketTrack => "PacketTrack" ,
317
+ ActionData :: ConnDeliver => "ConnDeliver" ,
319
318
_ => panic ! ( "Unknown ActionData" ) ,
320
- }
319
+ } ;
320
+ write ! ( f, "{}" , s)
321
321
}
322
322
}
323
323
0 commit comments