Fix dependency merging for rust-project.json

Test: SOONG_GEN_RUST_PROJECT=1 m nothing; inspect rust-project.json
Bug: 159591910
Change-Id: I95beb2e75f2306ae2bf2be02ab5f1a348d134b56
diff --git a/rust/project_json.go b/rust/project_json.go
index 24e7691..41dd194 100644
--- a/rust/project_json.go
+++ b/rust/project_json.go
@@ -92,7 +92,7 @@
 // appendLibraryAndDeps creates a rustProjectCrate for the module argument and
 // appends it to the rustProjectJson struct.  It visits the dependencies of the
 // module depth-first. If the current module is already in knownCrates, its
-// its dependencies are merged. Returns a tuple (id, crate_name, ok).
+// dependencies are merged. Returns a tuple (id, crate_name, ok).
 func appendLibraryAndDeps(ctx android.SingletonContext, project *rustProjectJson,
 	knownCrates map[string]crateInfo, module android.Module) (int, string, bool) {
 	rModule, ok := module.(*Module)
@@ -111,6 +111,7 @@
 		// We have seen this crate already; merge any new dependencies.
 		crate := project.Crates[cInfo.ID]
 		mergeDependencies(ctx, project, knownCrates, module, &crate, cInfo.Deps)
+		project.Crates[cInfo.ID] = crate
 		return cInfo.ID, crateName, true
 	}
 	crate := rustProjectCrate{Deps: make([]rustProjectDep, 0), Cfgs: make([]string, 0)}