File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " inline-str"
3
- version = " 0.1 .0"
3
+ version = " 0.2 .0"
4
4
edition = " 2021"
5
5
authors = [" Adam Gutglick <adamgsal@gmail.com>" ]
6
6
description = " Efficent and immutable string type, backed by inline-array"
@@ -13,3 +13,7 @@ categories = ["data-structures", "compression"]
13
13
14
14
[dependencies ]
15
15
inline-array = " 0.1.13"
16
+ serde = { version = " 1.0" , features = [" derive" ], optional = true }
17
+
18
+ [features ]
19
+ serde = [" inline-array/serde" , " dep:serde" ]
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ use std::{borrow::Cow, ops::Deref};
18
18
use inline_array:: InlineArray ;
19
19
20
20
#[ derive( PartialEq , Eq , PartialOrd , Ord ) ]
21
+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
21
22
pub struct InlineStr {
22
23
inner : InlineArray ,
23
24
}
@@ -86,19 +87,19 @@ impl<'a> PartialEq<&'a str> for InlineStr {
86
87
}
87
88
}
88
89
89
- impl < ' a > PartialEq < InlineStr > for & ' a str {
90
+ impl PartialEq < InlineStr > for & str {
90
91
fn eq ( & self , other : & InlineStr ) -> bool {
91
92
other. eq ( self )
92
93
}
93
94
}
94
95
95
- impl < ' a > PartialEq < Cow < ' a , str > > for InlineStr {
96
- fn eq ( & self , other : & Cow < ' a , str > ) -> bool {
96
+ impl PartialEq < Cow < ' _ , str > > for InlineStr {
97
+ fn eq ( & self , other : & Cow < ' _ , str > ) -> bool {
97
98
( * * self ) . eq ( other)
98
99
}
99
100
}
100
101
101
- impl < ' a > PartialEq < InlineStr > for Cow < ' a , str > {
102
+ impl PartialEq < InlineStr > for Cow < ' _ , str > {
102
103
fn eq ( & self , other : & InlineStr ) -> bool {
103
104
other. eq ( self )
104
105
}
You can’t perform that action at this time.
0 commit comments