Skip to content

Commit d5063a0

Browse files
committed
🚨 Fix cargo warnings 'uninlined_format_args'
Before, compilation logs contained: variables can be used directly in the `format!` string Fixed via `cargo clippy --fix`. https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
1 parent ae567d3 commit d5063a0

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

‎src/github_events/mod.rs‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,21 @@ pub(crate) fn github_events(repo: &str, token: &Option<String>) -> Result<Vec<Ra
3131
let body = match resp.text() {
3232
Ok(body) => {
3333
if body.len() <= "[]".len() {
34-
debug!("No more content for {:?} (page number: {})", repo, page);
34+
debug!("No more content for {repo:?} (page number: {page})");
3535
break;
3636
}
37-
debug!("Content found for {:?} (page number: {})", repo, page);
37+
debug!("Content found for {repo:?} (page number: {page})");
3838
trace!(
39-
"Content found for {:?} (page number: {}): {:?}",
40-
repo, page, body
39+
"Content found for {repo:?} (page number: {page}): {body:?}"
4140
);
4241
body
4342
}
4443
Err(error) => {
4544
if error.status() == Some(reqwest::StatusCode::UNPROCESSABLE_ENTITY) {
46-
debug!("No more content for {:?} (page number: {})", repo, page);
45+
debug!("No more content for {repo:?} (page number: {page})");
4746
break;
4847
}
49-
debug!("Oops, something went wrong with GitHub API {:?}", error);
48+
debug!("Oops, something went wrong with GitHub API {error:?}");
5049
return Err(Error::other(format!(
5150
"Cannot get GitHub API content: {error}"
5251
)));
@@ -62,7 +61,7 @@ pub(crate) fn github_events(repo: &str, token: &Option<String>) -> Result<Vec<Ra
6261
Some(link_header) => {
6362
let link_header = link_header.as_bytes();
6463
let last_page = last_page_from_link_header(str::from_utf8(link_header).unwrap());
65-
debug!("Last page: {:?} (current page: {})", last_page, page);
64+
debug!("Last page: {last_page:?} (current page: {page})");
6665
match last_page {
6766
Some(last_page) => {
6867
if page == last_page {
@@ -79,7 +78,7 @@ pub(crate) fn github_events(repo: &str, token: &Option<String>) -> Result<Vec<Ra
7978
}
8079

8180
fn raw_github_events(json: &str) -> Result<Vec<RawEvent>, serde_json::Error> {
82-
debug!("{}", json);
81+
debug!("{json}");
8382
serde_json::from_str::<Vec<RawEvent>>(json)
8483
}
8584

‎src/lib.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ pub fn log_github_events(os: Vec<OsString>) {
7373
let number_of_repos = config.repos.len();
7474

7575
for repo in config.repos {
76-
debug!("Query stats for GitHub repo {:?}", repo);
76+
debug!("Query stats for GitHub repo {repo:?}");
7777
let sender = mpsc::Sender::clone(&sender);
7878
let token = config.token.clone();
7979
thread::spawn(move || {

0 commit comments

Comments
 (0)