1
- use descriptor:: * ;
2
- use descriptorx:: * ;
3
- use rustproto;
4
- use wire_format;
5
- use rt;
6
- use rust;
7
- use text_format;
8
- use code_writer:: CodeWriter ;
9
- use types:: ProtobufType ;
10
- use reflect:: ProtobufValue ;
11
-
12
- use ext:: ExtFieldOptional ;
1
+ use protobuf:: descriptor:: * ;
2
+ use protobuf:: descriptorx:: * ;
3
+ use protobuf:: rustproto; // TODO: should probably live here
4
+ use protobuf:: wire_format;
5
+ use protobuf:: rt;
6
+ use protobuf:: rust;
7
+ use protobuf:: text_format;
8
+ use protobuf:: types:: ProtobufType ;
9
+ use protobuf:: reflect:: ProtobufValue ;
10
+
11
+ use protobuf:: ext:: ExtFieldOptional ;
13
12
14
13
use super :: message:: * ;
15
14
use super :: rust_types_values:: * ;
16
15
use super :: enums:: * ;
16
+ use super :: code_writer:: CodeWriter ;
17
17
18
18
19
19
@@ -26,7 +26,12 @@ fn type_is_copy(field_type: FieldDescriptorProto_Type) -> bool {
26
26
}
27
27
}
28
28
29
- impl FieldDescriptorProto_Type {
29
+ trait FieldDescriptorProtoTypeExt {
30
+ fn read ( & self , is : & str ) -> String ;
31
+ fn is_s_varint ( & self ) -> bool ;
32
+ }
33
+
34
+ impl FieldDescriptorProtoTypeExt for FieldDescriptorProto_Type {
30
35
fn read ( & self , is : & str ) -> String {
31
36
format ! ( "{}.read_{}()" , is, protobuf_name( * self ) )
32
37
}
@@ -42,7 +47,7 @@ impl FieldDescriptorProto_Type {
42
47
}
43
48
44
49
fn field_type_wire_type ( field_type : FieldDescriptorProto_Type ) -> wire_format:: WireType {
45
- use stream:: wire_format:: * ;
50
+ use protobuf :: stream:: wire_format:: * ;
46
51
match field_type {
47
52
FieldDescriptorProto_Type :: TYPE_INT32 => WireTypeVarint ,
48
53
FieldDescriptorProto_Type :: TYPE_INT64 => WireTypeVarint ,
0 commit comments