Browse Source

Update to more recent nightly

Mark Rousskov 5 years ago
parent
commit
f5c49351a8
4 changed files with 10 additions and 16 deletions
  1. 1 1
      Cargo.toml
  2. 1 1
      rust-toolchain
  3. 2 4
      src/github.rs
  4. 6 10
      src/handlers/assign.rs

+ 1 - 1
Cargo.toml

@@ -24,7 +24,7 @@ toml = "0.5.1"
 hyper = "0.12.32"
 futures-preview = { version = "=0.3.0-alpha.17", features = ["compat"] }
 uuid = { version = "0.7.4", features = ["v4"] }
-url = "1.7.2"
+url = "2.1.0"
 once_cell = "0.2.2"
 
 [dependencies.serde]

+ 1 - 1
rust-toolchain

@@ -1 +1 @@
-nightly-2019-08-26
+nightly-2019-10-11

+ 2 - 4
src/github.rs

@@ -83,10 +83,8 @@ pub struct Label {
 impl Label {
     async fn exists<'a>(&'a self, repo_api_prefix: &'a str, client: &'a GithubClient) -> bool {
         #[allow(clippy::redundant_pattern_matching)]
-        match client
-            .send_req(client.get(&format!("{}/labels/{}", repo_api_prefix, self.name)))
-            .await
-        {
+        let url = format!("{}/labels/{}", repo_api_prefix, self.name);
+        match client.send_req(client.get(&url)).await {
             Ok(_) => true,
             // XXX: Error handling if the request failed for reasons beyond 'label didn't exist'
             Err(_) => false,

+ 6 - 10
src/handlers/assign.rs

@@ -175,16 +175,12 @@ async fn handle_input(ctx: &Context, event: &Event, cmd: AssignCommand) -> Resul
                 .set_assignee(&ctx.github, &ctx.username)
                 .await
                 .context("self-assignment failed")?;
-            e.apply(
-                &ctx.github,
-                format!(
-                    "This issue has been assigned to @{} via [this comment]({}).",
-                    to_assign,
-                    event.html_url().unwrap()
-                ),
-                &data,
-            )
-            .await?;
+            let cmt_body = format!(
+                "This issue has been assigned to @{} via [this comment]({}).",
+                to_assign,
+                event.html_url().unwrap()
+            );
+            e.apply(&ctx.github, cmt_body, &data).await?;
         }
         Err(e) => return Err(e.into()),
     }