This repository was archived by the owner on Dec 29, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +7
-35
lines changed Expand file tree Collapse file tree 3 files changed +7
-35
lines changed Original file line number Diff line number Diff line change @@ -11,22 +11,20 @@ exclude = [
1111]
1212
1313[dependencies ]
14- rustc-serialize = { version = " 0.3" , optional = true }
1514log = " 0.4"
16- rls-data = " = 0.18.2 "
17- rls-span = " 0.4 "
15+ rls-data = " = 0.19 "
16+ rls-span = " 0.5 "
1817derive-new = " 0.5"
1918fst = { version = " 0.3" , default-features = false }
2019itertools = " 0.7.3"
2120json = " 0.11.13"
22- serde = { version = " 1.0" , optional = true }
23- serde_json = { version = " 1.0" , optional = true }
21+ serde = " 1.0"
22+ serde_json = " 1.0"
2423
2524[dev-dependencies ]
2625lazy_static = " 1"
2726env_logger = " 0.5"
2827
2928[features ]
30- default = [" serialize-rustc" ]
31- serialize-rustc = [" rustc-serialize" , " rls-data/serialize-rustc" , " rls-span/serialize-rustc" ]
32- serialize-serde = [" serde" , " serde_json" , " rls-data/serialize-serde" , " rls-span/serialize-serde" ]
29+ default = []
30+ derive = [" rls-data/derive" , " rls-span/derive" ]
Original file line number Diff line number Diff line change @@ -15,11 +15,7 @@ extern crate itertools;
1515extern crate json;
1616extern crate rls_data as data;
1717extern crate rls_span as span;
18- #[ cfg( feature = "serialize-rustc" ) ]
19- extern crate rustc_serialize;
20- #[ cfg( feature = "serialize-serde" ) ]
2118extern crate serde;
22- #[ cfg( feature = "serialize-serde" ) ]
2319extern crate serde_json;
2420
2521mod analysis;
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ fn read_crate_data(path: &Path) -> Option<Analysis> {
122122 Err ( err)
123123 } )
124124 . ok ( ) ?;
125- let s = decode_buf ( & buf)
125+ let s = :: serde_json :: from_str ( & buf)
126126 . or_else ( |err| {
127127 warn ! ( "deserialisation error: {:?}" , err) ;
128128 json:: parse ( & buf)
@@ -156,28 +156,6 @@ fn read_crate_data(path: &Path) -> Option<Analysis> {
156156 s
157157}
158158
159- #[ cfg( all( feature = "serialize-rustc" , not( feature = "serialize-serde" ) ) ) ]
160- fn decode_buf ( buf : & str ) -> Result < Option < Analysis > , rustc_serialize:: json:: DecoderError > {
161- :: rustc_serialize:: json:: decode ( buf)
162- }
163-
164- #[ cfg( all( feature = "serialize-serde" , not( feature = "serialize-rustc" ) ) ) ]
165- fn decode_buf ( buf : & str ) -> Result < Option < Analysis > , serde_json:: Error > {
166- :: serde_json:: from_str ( buf)
167- }
168-
169- #[ cfg( all( feature = "serialize-rustc" , feature = "serialize-serde" ) ) ]
170- fn decode_buf ( buf : & str ) -> Result < Option < Analysis > , Box < dyn std:: error:: Error > > {
171- compile_error ! ( "Features \" serialize-serde\" and \" serialize-rustc\" cannot both be enabled for this crate." )
172- }
173-
174- #[ cfg( not( any( feature = "serialize-serde" , feature = "serialize-rustc" ) ) ) ]
175- fn decode_buf ( buf : & str ) -> Result < Option < Analysis > , Box < dyn std:: error:: Error > > {
176- compile_error ! (
177- "Either feature \" serialize-serde\" or \" serialize-rustc\" must be enabled for this crate."
178- )
179- }
180-
181159pub fn name_space_for_def_kind ( dk : DefKind ) -> char {
182160 match dk {
183161 DefKind :: Enum
You can’t perform that action at this time.
0 commit comments