File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -33,14 +33,15 @@ impl EventPayload {
3333 }
3434 EventPayload :: Integer ( _) => false ,
3535 } ,
36- _ => false ,
36+ EventPayload :: Timestamp ( Timestamp :: Instant ( _ ) ) | EventPayload :: Integer ( _ ) => false ,
3737 }
3838 }
3939
4040 pub fn duration ( & self ) -> Option < Duration > {
41- match * self {
42- EventPayload :: Timestamp ( t) => t. duration ( ) ,
43- _ => None ,
41+ if let EventPayload :: Timestamp ( t) = * self {
42+ t. duration ( )
43+ } else {
44+ None
4445 }
4546 }
4647
@@ -109,9 +110,10 @@ impl Timestamp {
109110 }
110111
111112 pub fn duration ( & self ) -> Option < Duration > {
112- match * self {
113- Timestamp :: Interval { start, end } => end. duration_since ( start) . ok ( ) ,
114- _ => None ,
113+ if let Timestamp :: Interval { start, end } = * self {
114+ end. duration_since ( start) . ok ( )
115+ } else {
116+ None
115117 }
116118 }
117119}
Original file line number Diff line number Diff line change @@ -269,7 +269,7 @@ impl ProfilingDataBuilder {
269269 }
270270 }
271271
272- /// Record and interval event. Provide an `inner` function for recording
272+ /// Record an interval event. Provide an `inner` function for recording
273273 /// nested events.
274274 pub fn interval < F > (
275275 & mut self ,
You can’t perform that action at this time.
0 commit comments