File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,11 @@ struct CrateInformation {
144144 max_version : String ,
145145}
146146
147+ #[ derive( Deserialize , Debug ) ]
148+ struct WasmBindgenPackageJson {
149+ dependencies : Option < HashMap < String , String > > ,
150+ }
151+
147152impl Crate {
148153 /// Returns latest wasm-pack version
149154 pub fn return_wasm_pack_latest_version ( ) -> Result < Option < String > > {
@@ -629,9 +634,8 @@ impl CrateData {
629634 // we merge the NPM dependencies already specified in it.
630635 let existing_deps = if pkg_file_path. exists ( ) {
631636 // It's just a map of dependency names to versions
632- Some ( serde_json:: from_str :: < HashMap < String , String > > (
633- & fs:: read_to_string ( & pkg_file_path) ?,
634- ) ?)
637+ serde_json:: from_str :: < WasmBindgenPackageJson > ( & fs:: read_to_string ( & pkg_file_path) ?) ?
638+ . dependencies
635639 } else {
636640 None
637641 } ;
You can’t perform that action at this time.
0 commit comments