File tree Expand file tree Collapse file tree 6 files changed +9
-9
lines changed Expand file tree Collapse file tree 6 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " protocol"
3
- version = " 0.1.9 "
3
+ version = " 0.1.10 "
4
4
authors = [" Dylan McKay <dylanmckay34@gmail.com>" ]
5
5
6
6
description = " Easy protocol definitions"
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ macro_rules! define_packet
4
4
{
5
5
// Define a normal packet.
6
6
( $ty: ident { $( $field_name: ident : $field_ty: ty) ,+ } ) => {
7
- #[ derive( Clone , Debug ) ]
7
+ #[ derive( Clone , Debug , PartialEq ) ]
8
8
pub struct $ty
9
9
{
10
10
$( pub $field_name : $field_ty ) ,+
@@ -34,7 +34,7 @@ macro_rules! define_packet
34
34
35
35
// Define an empty packet.
36
36
( $ty: ident ) => {
37
- #[ derive( Clone , Debug ) ]
37
+ #[ derive( Clone , Debug , PartialEq ) ]
38
38
pub struct $ty;
39
39
40
40
impl $crate:: Parcel for $ty
@@ -57,7 +57,7 @@ macro_rules! define_packet
57
57
macro_rules! define_packet_kind
58
58
{
59
59
( $ty: ident : $id_ty: ty { $( $packet_id: expr => $packet_ty: ident ) ,+ } ) => {
60
- #[ derive( Clone , Debug ) ]
60
+ #[ derive( Clone , Debug , PartialEq ) ]
61
61
pub enum $ty
62
62
{
63
63
$( $packet_ty( $packet_ty) ) ,+
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ use std::io::prelude::*;
2
2
use std:: { fmt, io} ;
3
3
4
4
/// A value which can be read and written.
5
- pub trait Parcel : Clone + fmt:: Debug
5
+ pub trait Parcel : Clone + fmt:: Debug + PartialEq
6
6
{
7
7
/// Reads a value from a stream.
8
8
fn read ( read : & mut Read ) -> Result < Self , :: Error > ;
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ impl<T: Parcel> Parcel for Vec<T>
17
17
}
18
18
19
19
/// An array type with a custom size prefix type.
20
- #[ derive( Clone , Debug ) ]
20
+ #[ derive( Clone , Debug , PartialEq ) ]
21
21
pub struct Array < S : primitives:: Integer , T : Parcel >
22
22
{
23
23
pub elements : Vec < T > ,
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ macro_rules! implement_composite_type {
39
39
#[ macro_export]
40
40
macro_rules! define_composite_type {
41
41
( $ty: ident { $( $field_name: ident : $field_ty: ty ) ,+ } ) => {
42
- #[ derive( Clone , Debug , PartialEq ) ]
42
+ #[ derive( Clone , Debug , PartialEq ) ]
43
43
pub struct $ty
44
44
{
45
45
$( pub $field_name : $field_ty ) ,+
@@ -58,7 +58,7 @@ mod test
58
58
pub use Parcel ;
59
59
pub use std:: io:: Cursor ;
60
60
61
- #[ derive( Clone , Debug ) ]
61
+ #[ derive( Clone , Debug , PartialEq ) ]
62
62
pub struct Foo
63
63
{
64
64
baz : String ,
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ impl Parcel for std::string::String
19
19
20
20
/// A string with a custom size prefix integer type.
21
21
/// `S` - The size prefix type.
22
- #[ derive( Clone , Debug ) ]
22
+ #[ derive( Clone , Debug , PartialEq ) ]
23
23
pub struct String < S : primitives:: Integer = u32 >
24
24
{
25
25
pub value : std:: string:: String ,
You can’t perform that action at this time.
0 commit comments