Skip to content

Commit b8411f2

Browse files
committed
Implement Display for EventSource
1 parent 96fe473 commit b8411f2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lighthouse-protocol/src/input/event_source.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use std::fmt;
2+
13
use serde::{Deserialize, Serialize};
24

35
/// An identifier that is unique per client + device combo.
@@ -7,3 +9,12 @@ pub enum EventSource {
79
String(String),
810
Int(i32),
911
}
12+
13+
impl fmt::Display for EventSource {
14+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
15+
match self {
16+
EventSource::String(s) => write!(f, "{s}"),
17+
EventSource::Int(i) => write!(f, "{i}"),
18+
}
19+
}
20+
}

0 commit comments

Comments
 (0)