From a5bda29ac36ce53518cc393fa7d5512af115b234 Mon Sep 17 00:00:00 2001 From: Tim de Jager Date: Fri, 23 Jun 2023 10:24:48 +0200 Subject: [PATCH 1/2] fix: fix add command --- src/project/mod.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/project/mod.rs b/src/project/mod.rs index 35988d308..d68187b53 100644 --- a/src/project/mod.rs +++ b/src/project/mod.rs @@ -160,11 +160,12 @@ impl Project { // TODO: Do this smarter. E.g.: // - split this into an object if exotic properties (like channel) are specified. // - split the name from the rest of the requirement. - let spec_string = spec.to_string(); - let requirement = spec_string.split_once(' ').unwrap_or(("", "*")).1; + let nameless = NamelessMatchSpec::from(spec.to_owned()); // Store (or replace) in the document - deps_table.insert(name, Item::Value(requirement.into())); + deps_table.insert(name, Item::Value(nameless.to_string().into())); + + self.manifest.dependencies.insert(name.to_string(), nameless); Ok(()) } From 999466d6b3822009b35a2da2bf3291ca0262b830 Mon Sep 17 00:00:00 2001 From: Tim de Jager Date: Fri, 23 Jun 2023 10:51:08 +0200 Subject: [PATCH 2/2] fix: formatting --- src/project/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/project/mod.rs b/src/project/mod.rs index d68187b53..656393d82 100644 --- a/src/project/mod.rs +++ b/src/project/mod.rs @@ -165,7 +165,9 @@ impl Project { // Store (or replace) in the document deps_table.insert(name, Item::Value(nameless.to_string().into())); - self.manifest.dependencies.insert(name.to_string(), nameless); + self.manifest + .dependencies + .insert(name.to_string(), nameless); Ok(()) }