Skip to content

Commit 0e5975a

Browse files
committed
use Itertools::format
1 parent 9d9ea52 commit 0e5975a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/github.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use async_trait::async_trait;
44
use bytes::Bytes;
55
use chrono::{DateTime, FixedOffset, Utc};
66
use futures::{FutureExt, future::BoxFuture};
7+
use itertools::Itertools;
78
use octocrab::models::{Author, AuthorAssociation};
89
use regex::Regex;
910
use reqwest::header::{AUTHORIZATION, USER_AGENT};
@@ -1508,8 +1509,7 @@ impl Repository {
15081509
.chain([format!("sort={}", ordering.sort)])
15091510
.chain([format!("direction={}", ordering.direction)])
15101511
.chain([format!("per_page={}", ordering.per_page)])
1511-
.collect::<Vec<_>>()
1512-
.join("&");
1512+
.format("&");
15131513
format!(
15141514
"{}/repos/{}/{}?{}",
15151515
client.api_url, self.full_name, endpoint, filters
@@ -1531,8 +1531,7 @@ impl Repository {
15311531
.chain(include_labels.iter().map(|label| format!("label:{label}")))
15321532
.chain(exclude_labels.iter().map(|label| format!("-label:{label}")))
15331533
.chain([format!("repo:{}", self.full_name)])
1534-
.collect::<Vec<_>>()
1535-
.join("+");
1534+
.format("+");
15361535
format!(
15371536
"{}/search/issues?q={}&sort={}&order={}&per_page={}&page={}",
15381537
client.api_url,
@@ -1633,7 +1632,7 @@ impl Repository {
16331632
client: &GithubClient,
16341633
refname: &str,
16351634
) -> anyhow::Result<GitReference> {
1636-
let url = format!("{}/git/ref/{}", self.url(client), refname);
1635+
let url = format!("{}/git/ref/{refname}", self.url(client));
16371636
client
16381637
.json(client.get(&url))
16391638
.await

0 commit comments

Comments
 (0)