Skip to content

Commit

Permalink
fix comments && unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-Busch committed Mar 27, 2023
1 parent 5ee5506 commit e7c70cd
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "github-assistant"
version = "0.1.1"
version = "0.1.2"
edition = "2021"
authors = ["simon Busch <[email protected]>"]
description = "Keep track of your github assignments"
Expand Down
14 changes: 6 additions & 8 deletions src/api/fetch_github_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,13 @@ pub async fn get_github_response(username: &str, access_token: &str, status: &st
item.repository = Some(url_parts[url_parts.len() - 3].to_string());
item.organization = Some(url_parts[url_parts.len() - 4].to_string());
item.is_pr = url_parts.contains(&"pull");
if item.state == "open" {
let comments_url = &item.comments_url;
let comments_response = client.get(comments_url).send().await?;
if !comments_response.status().is_success() {
println!("Error: {}", comments_response.status());
}
let comments_json: Vec<IssueComments> = comments_response.json().await?;
item.comments_list = comments_json;
let comments_url = &item.comments_url;
let comments_response = client.get(comments_url).send().await?;
if !comments_response.status().is_success() {
println!("Error: {}", comments_response.status());
}
let comments_json: Vec<IssueComments> = comments_response.json().await?;
item.comments_list = comments_json;
}
Ok(items)
}
2 changes: 1 addition & 1 deletion src/api/update_issue_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub async fn update_issue_status(repo_owner: String, repo_name: String, issue_nu
}.to_string();
let base_url = "https://api.github.com";
let patch_url = format!("{}/repos/{}/{}/issues/{}", base_url, repo_owner, repo_name, issue_number);
let response = client
let _response = client
.patch(&patch_url)
.header("Authorization", format!("token {}", access_token))
.header("Content-Type", "application/json")
Expand Down
2 changes: 1 addition & 1 deletion src/render_items/render_issues.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ pub fn render_issues<'a>(issues: &Vec<ApiResponseItem>, selected_issue_index: Op
]),
Row::new(vec![comments_cell])
.style(Style::default().fg(Color::White))
.height(50),
.height(30),
])
.block(
Block::default()
Expand Down

0 comments on commit e7c70cd

Please sign in to comment.