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 {
44
44
pub fn from_virtual ( virtual_id : StringId ) -> EventId {
45
45
EventId ( virtual_id)
46
46
}
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
+ }
47
54
}
48
55
49
56
pub struct EventIdBuilder < ' p , S : SerializationSink > {
Original file line number Diff line number Diff line change @@ -149,8 +149,8 @@ impl RawEvent {
149
149
{
150
150
use byteorder:: { ByteOrder , LittleEndian } ;
151
151
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 ..] ) ) ,
154
154
thread_id : LittleEndian :: read_u32 ( & bytes[ 8 ..] ) ,
155
155
start_time_lower : LittleEndian :: read_u32 ( & bytes[ 12 ..] ) ,
156
156
end_time_lower : LittleEndian :: read_u32 ( & bytes[ 16 ..] ) ,
You can’t perform that action at this time.
0 commit comments