Cleaned up a bit
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
Martin Slot 2022-12-17 17:13:58 +01:00
parent c335ae7792
commit 0687cc92d6
1 changed files with 4 additions and 10 deletions

View File

@ -3,10 +3,8 @@ use crate::request::models::{Current, GithubRelease, State};
use crate::request::notification::Notification;
use crate::request::versioning::{SemverVersionComparer, VersionComparer};
use crate::{Print, Settings};
use reqwest::get;
use reqwest::header::{ACCEPT, ACCEPT_ENCODING, ACCEPT_LANGUAGE};
use reqwest::header::ACCEPT;
use std::cmp::Ordering;
use std::io::Read;
use std::time::Duration;
pub fn init<'a>(
@ -57,12 +55,9 @@ impl<'a> RequestHandler<'a> {
.build()
.unwrap();
let mut return_json = client
let return_json = client
.get(&latest_release_api_url)
.header(ACCEPT, "application/vnd.github.v3+json")
// .header("X-Github-Api-Version", "2022-11-28")
// .header(ACCEPT_LANGUAGE, "en-US")
// .header(ACCEPT_ENCODING, "gzip, deflate, br")
.send()
.unwrap();
@ -89,7 +84,7 @@ impl<'a> RequestHandler<'a> {
send_alerts_for.push(State::new(release, current.clone()));
} else {
println!(
"Current version for {:?} is alligned with or larger than CVS",
"Current version for {:?} is aligned with or larger than CVS",
current
);
}
@ -143,10 +138,9 @@ JOIN VcsTypes V ON O.vcs_type = V.vcs_type";
}
pub mod notification {
use crate::request::models::{Current, State};
use crate::request::models::State;
use lettre::transport::smtp::authentication::Credentials;
use lettre::{Message, SmtpTransport, Transport};
use std::thread::current;
pub trait Notification {
fn send(&self, currents: &Vec<State>);