@@ -9,42 +9,44 @@ use crate::{TraceLowLevelEvent, VariableId};
99/// The header is 8 bytes in size, ensuring 64-bit alignment for the rest of the file.
1010const HEADER : & [ u8 ] = & [ 0xC0 , 0xDE , 0x72 , 0xAC , 0xE2 , 0x00 , 0x00 , 0x00 ] ;
1111
12- fn conv_typekind ( kind : crate :: TypeKind ) -> trace:: TypeKind {
13- match kind {
14- crate :: TypeKind :: Seq => trace:: TypeKind :: Seq ,
15- crate :: TypeKind :: Set => trace:: TypeKind :: Set ,
16- crate :: TypeKind :: HashSet => trace:: TypeKind :: HashSet ,
17- crate :: TypeKind :: OrderedSet => trace:: TypeKind :: OrderedSet ,
18- crate :: TypeKind :: Array => trace:: TypeKind :: Array ,
19- crate :: TypeKind :: Varargs => trace:: TypeKind :: Varargs ,
20- crate :: TypeKind :: Struct => trace:: TypeKind :: Struct ,
21- crate :: TypeKind :: Int => trace:: TypeKind :: Int ,
22- crate :: TypeKind :: Float => trace:: TypeKind :: Float ,
23- crate :: TypeKind :: String => trace:: TypeKind :: String ,
24- crate :: TypeKind :: CString => trace:: TypeKind :: Cstring ,
25- crate :: TypeKind :: Char => trace:: TypeKind :: Char ,
26- crate :: TypeKind :: Bool => trace:: TypeKind :: Bool ,
27- crate :: TypeKind :: Literal => trace:: TypeKind :: Literal ,
28- crate :: TypeKind :: Ref => trace:: TypeKind :: Ref ,
29- crate :: TypeKind :: Recursion => trace:: TypeKind :: Recursion ,
30- crate :: TypeKind :: Raw => trace:: TypeKind :: Raw ,
31- crate :: TypeKind :: Enum => trace:: TypeKind :: Enum ,
32- crate :: TypeKind :: Enum16 => trace:: TypeKind :: Enum16 ,
33- crate :: TypeKind :: Enum32 => trace:: TypeKind :: Enum32 ,
34- crate :: TypeKind :: C => trace:: TypeKind :: C ,
35- crate :: TypeKind :: TableKind => trace:: TypeKind :: TableKind ,
36- crate :: TypeKind :: Union => trace:: TypeKind :: Union ,
37- crate :: TypeKind :: Pointer => trace:: TypeKind :: Pointer ,
38- crate :: TypeKind :: Error => trace:: TypeKind :: Error ,
39- crate :: TypeKind :: FunctionKind => trace:: TypeKind :: FunctionKind ,
40- crate :: TypeKind :: TypeValue => trace:: TypeKind :: TypeValue ,
41- crate :: TypeKind :: Tuple => trace:: TypeKind :: Tuple ,
42- crate :: TypeKind :: Variant => trace:: TypeKind :: Variant ,
43- crate :: TypeKind :: Html => trace:: TypeKind :: Html ,
44- crate :: TypeKind :: None => trace:: TypeKind :: None ,
45- crate :: TypeKind :: NonExpanded => trace:: TypeKind :: NonExpanded ,
46- crate :: TypeKind :: Any => trace:: TypeKind :: Any ,
47- crate :: TypeKind :: Slice => trace:: TypeKind :: Slice ,
12+ impl From < crate :: TypeKind > for trace:: TypeKind {
13+ fn from ( item : crate :: TypeKind ) -> Self {
14+ match item {
15+ crate :: TypeKind :: Seq => trace:: TypeKind :: Seq ,
16+ crate :: TypeKind :: Set => trace:: TypeKind :: Set ,
17+ crate :: TypeKind :: HashSet => trace:: TypeKind :: HashSet ,
18+ crate :: TypeKind :: OrderedSet => trace:: TypeKind :: OrderedSet ,
19+ crate :: TypeKind :: Array => trace:: TypeKind :: Array ,
20+ crate :: TypeKind :: Varargs => trace:: TypeKind :: Varargs ,
21+ crate :: TypeKind :: Struct => trace:: TypeKind :: Struct ,
22+ crate :: TypeKind :: Int => trace:: TypeKind :: Int ,
23+ crate :: TypeKind :: Float => trace:: TypeKind :: Float ,
24+ crate :: TypeKind :: String => trace:: TypeKind :: String ,
25+ crate :: TypeKind :: CString => trace:: TypeKind :: Cstring ,
26+ crate :: TypeKind :: Char => trace:: TypeKind :: Char ,
27+ crate :: TypeKind :: Bool => trace:: TypeKind :: Bool ,
28+ crate :: TypeKind :: Literal => trace:: TypeKind :: Literal ,
29+ crate :: TypeKind :: Ref => trace:: TypeKind :: Ref ,
30+ crate :: TypeKind :: Recursion => trace:: TypeKind :: Recursion ,
31+ crate :: TypeKind :: Raw => trace:: TypeKind :: Raw ,
32+ crate :: TypeKind :: Enum => trace:: TypeKind :: Enum ,
33+ crate :: TypeKind :: Enum16 => trace:: TypeKind :: Enum16 ,
34+ crate :: TypeKind :: Enum32 => trace:: TypeKind :: Enum32 ,
35+ crate :: TypeKind :: C => trace:: TypeKind :: C ,
36+ crate :: TypeKind :: TableKind => trace:: TypeKind :: TableKind ,
37+ crate :: TypeKind :: Union => trace:: TypeKind :: Union ,
38+ crate :: TypeKind :: Pointer => trace:: TypeKind :: Pointer ,
39+ crate :: TypeKind :: Error => trace:: TypeKind :: Error ,
40+ crate :: TypeKind :: FunctionKind => trace:: TypeKind :: FunctionKind ,
41+ crate :: TypeKind :: TypeValue => trace:: TypeKind :: TypeValue ,
42+ crate :: TypeKind :: Tuple => trace:: TypeKind :: Tuple ,
43+ crate :: TypeKind :: Variant => trace:: TypeKind :: Variant ,
44+ crate :: TypeKind :: Html => trace:: TypeKind :: Html ,
45+ crate :: TypeKind :: None => trace:: TypeKind :: None ,
46+ crate :: TypeKind :: NonExpanded => trace:: TypeKind :: NonExpanded ,
47+ crate :: TypeKind :: Any => trace:: TypeKind :: Any ,
48+ crate :: TypeKind :: Slice => trace:: TypeKind :: Slice ,
49+ }
4850 }
4951}
5052
@@ -237,7 +239,7 @@ pub fn write_trace(q: &[crate::TraceLowLevelEvent], output: &mut impl std::io::W
237239 TraceLowLevelEvent :: Type ( type_record) => {
238240 let mut typ = event. init_type ( ) ;
239241
240- typ. set_kind ( conv_typekind ( type_record. kind ) ) ;
242+ typ. set_kind ( type_record. kind . into ( ) ) ;
241243 typ. set_lang_type ( type_record. lang_type . clone ( ) ) ;
242244 let mut specific_info = typ. init_specific_info ( ) ;
243245 match & type_record. specific_info {
0 commit comments