File tree 5 files changed +9
-5
lines changed
5 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 22
22
- {name: ciborium-ll}
23
23
- {name: ciborium}
24
24
- {name: ciborium, feat: std}
25
- - {name: ciborium, feat: canonical}
26
25
- {name: ciborium-io}
27
26
- {name: ciborium-io, feat: alloc}
28
27
- {name: ciborium-io, feat: std}
Original file line number Diff line number Diff line change @@ -18,23 +18,26 @@ impl<W: Write> From<W> for Encoder<W> {
18
18
impl < W : Write > Write for Encoder < W > {
19
19
type Error = W :: Error ;
20
20
21
+ #[ inline]
21
22
fn write_all ( & mut self , data : & [ u8 ] ) -> Result < ( ) , Self :: Error > {
22
23
self . 0 . write_all ( data)
23
24
}
24
25
26
+ #[ inline]
25
27
fn flush ( & mut self ) -> Result < ( ) , Self :: Error > {
26
28
self . 0 . flush ( )
27
29
}
28
30
}
29
31
30
32
impl < W : Write > Encoder < W > {
31
33
/// Unwraps the `Write`, consuming the `Encoder`.
34
+ #[ inline]
32
35
pub fn into_inner ( self ) -> W {
33
36
self . 0
34
37
}
35
38
36
39
/// Push a `Header` to the wire
37
- #[ inline]
40
+ #[ inline( always ) ]
38
41
pub fn push ( & mut self , header : Header ) -> Result < ( ) , W :: Error > {
39
42
let title = Title :: from ( header) ;
40
43
Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ pub enum Header {
75
75
impl TryFrom < Title > for Header {
76
76
type Error = InvalidError ;
77
77
78
+ #[ inline]
78
79
fn try_from ( title : Title ) -> Result < Self , Self :: Error > {
79
80
let opt = |minor| {
80
81
Some ( match minor {
@@ -116,6 +117,7 @@ impl TryFrom<Title> for Header {
116
117
}
117
118
118
119
impl From < Header > for Title {
120
+ #[ inline( always) ]
119
121
fn from ( header : Header ) -> Self {
120
122
let int = |i : u64 | match i {
121
123
x if x <= 23 => Minor :: This ( i as u8 ) ,
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ use serde::ser::{Error as SerError, StdError};
10
10
pub enum Error < T > {
11
11
/// An error occurred while writing bytes
12
12
///
13
- /// Contains the underlying error reaturned while writing.
13
+ /// Contains the underlying error returned while writing.
14
14
Io ( T ) ,
15
15
16
16
/// An error indicating a value that cannot be serialized
Original file line number Diff line number Diff line change @@ -508,7 +508,7 @@ where
508
508
serializer,
509
509
collection_type,
510
510
length,
511
- tag_written : false ,
511
+ tag_written : ! matches ! ( collection_type , CollectionType :: Tag ) ,
512
512
#[ cfg( feature = "std" ) ]
513
513
cache_keys : Vec :: new ( ) ,
514
514
#[ cfg( feature = "std" ) ]
@@ -645,7 +645,7 @@ where
645
645
& mut self ,
646
646
value : & U ,
647
647
) -> Result < ( ) , Self :: Error > {
648
- if self . tag_written || ! matches ! ( self . collection_type , CollectionType :: Tag ) {
648
+ if self . tag_written {
649
649
// untagged tuples are CollectionType::Array to skip writing the tag header
650
650
return self . inline_serialize_value ( value) ;
651
651
}
You can’t perform that action at this time.
0 commit comments