Skip to content

Commit afd952d

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 afd952d

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

‎src/github_events/mod.rs‎

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,19 @@ 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);
38-
trace!(
39-
"Content found for {:?} (page number: {}): {:?}",
40-
repo, page, body
41-
);
37+
debug!("Content found for {repo:?} (page number: {page})");
38+
trace!("Content found for {repo:?} (page number: {page}): {body:?}");
4239
body
4340
}
4441
Err(error) => {
4542
if error.status() == Some(reqwest::StatusCode::UNPROCESSABLE_ENTITY) {
46-
debug!("No more content for {:?} (page number: {})", repo, page);
43+
debug!("No more content for {repo:?} (page number: {page})");
4744
break;
4845
}
49-
debug!("Oops, something went wrong with GitHub API {:?}", error);
46+
debug!("Oops, something went wrong with GitHub API {error:?}");
5047
return Err(Error::other(format!(
5148
"Cannot get GitHub API content: {error}"
5249
)));
@@ -62,7 +59,7 @@ pub(crate) fn github_events(repo: &str, token: &Option<String>) -> Result<Vec<Ra
6259
Some(link_header) => {
6360
let link_header = link_header.as_bytes();
6461
let last_page = last_page_from_link_header(str::from_utf8(link_header).unwrap());
65-
debug!("Last page: {:?} (current page: {})", last_page, page);
62+
debug!("Last page: {last_page:?} (current page: {page})");
6663
match last_page {
6764
Some(last_page) => {
6865
if page == last_page {
@@ -79,7 +76,7 @@ pub(crate) fn github_events(repo: &str, token: &Option<String>) -> Result<Vec<Ra
7976
}
8077

8178
fn raw_github_events(json: &str) -> Result<Vec<RawEvent>, serde_json::Error> {
82-
debug!("{}", json);
79+
debug!("{json}");
8380
serde_json::from_str::<Vec<RawEvent>>(json)
8481
}
8582

‎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)