i don't know if this works but i should commit
authorNatalie Boehm <nmb56@pitt.edu>
Tue, 26 Sep 2017 21:01:50 +0000 (17:01 -0400)
committerNatalie Boehm <nmb56@pitt.edu>
Tue, 26 Sep 2017 21:01:50 +0000 (17:01 -0400)
src/cargo/ops/registry.rs
src/crates-io/lib.rs

index 6d7cf670123933efc6ff2e846b2cd32f16064a43..72c41405bca46a466b46081c67731be625b29eba 100644 (file)
@@ -320,11 +320,13 @@ pub fn modify_owners(config: &Config, opts: &OwnersOptions) -> CargoResult<()> {
 
     if let Some(ref v) = opts.to_add {
         let v = v.iter().map(|s| &s[..]).collect::<Vec<_>>();
-        config.shell().status("Owner", format!("adding {:?} to crate {}",
-                                                    v, name))?;
-        registry.add_owners(&name, &v).map_err(|e| {
-            CargoError::from(format!("failed to add owners to crate {}: {}", name, e))
+        //config.shell().status("Owner", format!("adding {:?} to crate {}",
+        //                                            v, name))?;
+        let msg = registry.add_owners(&name, &v).map_err(|e| {
+            CargoError::from(format!("failed to invite owners to crate {}: {}", name, e))
         })?;
+
+        config.shell().status("Owner", msg)?;
     }
 
     if let Some(ref v) = opts.to_remove {
index cd8df416d8d87ea6bd394b3f65eac017d62cb062..56ff3b275f8ea08b16083a7449e29e626d88c6c8 100644 (file)
@@ -137,12 +137,13 @@ impl Registry {
         }
     }
 
-    pub fn add_owners(&mut self, krate: &str, owners: &[&str]) -> Result<()> {
+    pub fn add_owners(&mut self, krate: &str, owners: &[&str]) -> Result<String> {
         let body = serde_json::to_string(&OwnersReq { users: owners })?;
         let body = self.put(format!("/crates/{}/owners", krate),
                                  body.as_bytes())?;
-        assert!(serde_json::from_str::<R>(&body)?.ok);
-        Ok(())
+        //assert!(serde_json::from_str::<R>(&body)?.ok);
+        //Ok(())
+        Ok(body)
     }
 
     pub fn remove_owners(&mut self, krate: &str, owners: &[&str]) -> Result<()> {