Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
owenizedd committed Nov 5, 2023
1 parent 391a423 commit 771c800
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/utils/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ pub async fn display_remote_version_list(){
match tags {
Ok(tags) => {
for tag in tags {
//print tag of type () as string and remove suffix "bun-"
let tag_string = format!("{:?}", tag).replace("bun-", "").replace("\"", "");
println!(" {}", tag_string);
}
Expand Down
9 changes: 2 additions & 7 deletions src/utils/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,13 @@ pub fn get_bumrc_version() -> Result<String, &'static str> {
}


pub async fn get_github_tags(url: &str) -> Result<Vec<String>, Box<dyn Error>> {

// Make a GET request to the GitHub API

let client = reqwest::Client::builder().user_agent("bum").build().unwrap();
pub async fn get_github_tags(url: &str) -> Result<Vec<String>, Box<dyn Error>> {
let client = reqwest::Client::builder().user_agent("bum-version-manager-app").build().unwrap();
let response = client.get(url).send().await?;

let response_string = response.text().await?;
// print!("{}", response_string);
let response_json: Value = serde_json::from_str(&response_string).unwrap();

// Extract version numbers and convert to a vector of strings only if string starts with "bun-"
let tags_vec: Vec<String> = response_json
.as_array()
.unwrap()
Expand Down

0 comments on commit 771c800

Please sign in to comment.