File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,13 @@ impl EventId {
4444 pub fn from_virtual ( virtual_id : StringId ) -> EventId {
4545 EventId ( virtual_id)
4646 }
47+
48+ /// Create an EventId from a raw u32 value. Only used internally for
49+ /// deserialization.
50+ #[ inline]
51+ pub fn from_u32 ( raw_id : u32 ) -> EventId {
52+ EventId ( StringId :: new ( raw_id) )
53+ }
4754}
4855
4956pub struct EventIdBuilder < ' p , S : SerializationSink > {
Original file line number Diff line number Diff line change @@ -149,8 +149,8 @@ impl RawEvent {
149149 {
150150 use byteorder:: { ByteOrder , LittleEndian } ;
151151 RawEvent {
152- event_kind : StringId :: reserved ( LittleEndian :: read_u32 ( & bytes[ 0 ..] ) ) ,
153- event_id : StringId :: reserved ( LittleEndian :: read_u32 ( & bytes[ 4 ..] ) ) ,
152+ event_kind : StringId :: new ( LittleEndian :: read_u32 ( & bytes[ 0 ..] ) ) ,
153+ event_id : EventId :: from_u32 ( LittleEndian :: read_u32 ( & bytes[ 4 ..] ) ) ,
154154 thread_id : LittleEndian :: read_u32 ( & bytes[ 8 ..] ) ,
155155 start_time_lower : LittleEndian :: read_u32 ( & bytes[ 12 ..] ) ,
156156 end_time_lower : LittleEndian :: read_u32 ( & bytes[ 16 ..] ) ,
You can’t perform that action at this time.
0 commit comments