Skip to content

Commit be73829

Browse files
committed
Address PR nits
1 parent 0f767ae commit be73829

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

analyzeme/src/event_payload.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff 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
}

analyzeme/src/profiling_data.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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,

0 commit comments

Comments
 (0)