From a42393864e84daeae0efa939aa5ca9654382f28a Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Sat, 24 Feb 2024 13:44:06 +0000 Subject: [PATCH] automatic cargo CI changes --- src/error.rs | 4 ++-- src/release/mod.rs | 4 ++-- src/serverapi/forgejo.rs | 19 ++++++++++++------- src/serverapi/gitea.rs | 10 +++++----- src/serverapi/github.rs | 10 +++++----- src/serverapi/gitlab.rs | 10 +++++----- src/serverapi/mod.rs | 2 +- 7 files changed, 32 insertions(+), 27 deletions(-) diff --git a/src/error.rs b/src/error.rs index a80473f..7dd062a 100644 --- a/src/error.rs +++ b/src/error.rs @@ -21,7 +21,7 @@ pub enum Error { #[error("Could not generate the changelog")] ChangelogError(#[from] ChangelogError), #[error("Server Api error")] - ServerApiError(#[from] ServerApiError) + ServerApiError(#[from] ServerApiError), } #[derive(Error, Debug)] @@ -31,7 +31,7 @@ pub enum ServerApiError { #[error(transparent)] InvalidHeaderValue(#[from] reqwest::header::InvalidHeaderValue), #[error(transparent)] - ReqwestErr(#[from] reqwest::Error) + ReqwestErr(#[from] reqwest::Error), } #[derive(Error, Debug)] diff --git a/src/release/mod.rs b/src/release/mod.rs index 2482340..26af656 100644 --- a/src/release/mod.rs +++ b/src/release/mod.rs @@ -7,10 +7,10 @@ pub struct ReleaseContext { pub repository: String, pub text: String, pub tag: String, - pub commit_sig: String + pub commit_sig: String, } -pub async fn release(cfg: &Config, apis: &mut ApiCollection) -> Result<()> { +pub async fn release(cfg: &Config, _apis: &mut ApiCollection) -> Result<()> { // TODO: git tag // TODO: push to each server diff --git a/src/serverapi/forgejo.rs b/src/serverapi/forgejo.rs index 94c6188..b6eab8a 100644 --- a/src/serverapi/forgejo.rs +++ b/src/serverapi/forgejo.rs @@ -1,12 +1,12 @@ use crate::{ - config::{packages::PackageType, Api, ApiType, Config}, + config::{Api, Config}, error::*, serverapi::{PublishContext, ReleaseContext, ServerApi}, }; use async_trait::async_trait; use reqwest::{ header::{HeaderMap, HeaderValue}, - Client, Method, Request, RequestBuilder, Url, + Client, Url, }; pub struct Forgejo { @@ -38,7 +38,7 @@ impl Forgejo { #[async_trait] impl ServerApi for Forgejo { - async fn init(&mut self, cfg: &Config) -> Result<()> { + async fn init(&mut self, _cfg: &Config) -> Result<()> { todo!() } async fn push_release(&mut self, rc: &ReleaseContext) -> Result<()> { @@ -65,14 +65,19 @@ impl ServerApi for Forgejo { .client .post(url) .body(body) - .build().map_err(ServerApiError::from)?; - let response = self.client.execute(request).await.map_err(ServerApiError::from)?; + .build() + .map_err(ServerApiError::from)?; + let _response = self + .client + .execute(request) + .await + .map_err(ServerApiError::from)?; Ok(()) } - async fn push_release_artifact(&mut self, rc: &ReleaseContext) -> Result<()> { + async fn push_release_artifact(&mut self, _rc: &ReleaseContext) -> Result<()> { todo!() } - async fn push_pkg(&mut self, pc: &PublishContext) -> Result<()> { + async fn push_pkg(&mut self, _pc: &PublishContext) -> Result<()> { todo!() } } diff --git a/src/serverapi/gitea.rs b/src/serverapi/gitea.rs index e222545..3cad481 100644 --- a/src/serverapi/gitea.rs +++ b/src/serverapi/gitea.rs @@ -2,7 +2,7 @@ use async_trait::async_trait; use super::{PublishContext, ReleaseContext, ServerApi}; use crate::{ - config::{packages::PackageType, Api, ApiType, Config}, + config::{Api, Config}, error::*, }; pub struct Gitea { @@ -11,16 +11,16 @@ pub struct Gitea { #[async_trait] impl ServerApi for Gitea { - async fn init(&mut self, cfg: &Config) -> Result<()> { + async fn init(&mut self, _cfg: &Config) -> Result<()> { todo!() } - async fn push_release(&mut self, rc: &ReleaseContext) -> Result<()> { + async fn push_release(&mut self, _rc: &ReleaseContext) -> Result<()> { todo!() } - async fn push_release_artifact(&mut self, rc: &ReleaseContext) -> Result<()> { + async fn push_release_artifact(&mut self, _rc: &ReleaseContext) -> Result<()> { todo!() } - async fn push_pkg(&mut self, pc: &PublishContext) -> Result<()> { + async fn push_pkg(&mut self, _pc: &PublishContext) -> Result<()> { todo!() } } diff --git a/src/serverapi/github.rs b/src/serverapi/github.rs index 2fd61fa..49c2807 100644 --- a/src/serverapi/github.rs +++ b/src/serverapi/github.rs @@ -2,7 +2,7 @@ use async_trait::async_trait; use super::{PublishContext, ReleaseContext, ServerApi}; use crate::{ - config::{packages::PackageType, Api, ApiType, Config}, + config::{Api, Config}, error::*, }; pub struct Github { @@ -11,16 +11,16 @@ pub struct Github { #[async_trait] impl ServerApi for Github { - async fn init(&mut self, cfg: &Config) -> Result<()> { + async fn init(&mut self, _cfg: &Config) -> Result<()> { todo!() } - async fn push_release(&mut self, rc: &ReleaseContext) -> Result<()> { + async fn push_release(&mut self, _rc: &ReleaseContext) -> Result<()> { todo!() } - async fn push_release_artifact(&mut self, rc: &ReleaseContext) -> Result<()> { + async fn push_release_artifact(&mut self, _rc: &ReleaseContext) -> Result<()> { todo!() } - async fn push_pkg(&mut self, pc: &PublishContext) -> Result<()> { + async fn push_pkg(&mut self, _pc: &PublishContext) -> Result<()> { todo!() } } diff --git a/src/serverapi/gitlab.rs b/src/serverapi/gitlab.rs index 8b39979..4151222 100644 --- a/src/serverapi/gitlab.rs +++ b/src/serverapi/gitlab.rs @@ -2,7 +2,7 @@ use async_trait::async_trait; use super::{PublishContext, ReleaseContext, ServerApi}; use crate::{ - config::{packages::PackageType, Api, ApiType, Config}, + config::{Api, Config}, error::*, }; pub struct Gitlab { @@ -11,16 +11,16 @@ pub struct Gitlab { #[async_trait] impl ServerApi for Gitlab { - async fn init(&mut self, cfg: &Config) -> Result<()> { + async fn init(&mut self, _cfg: &Config) -> Result<()> { todo!() } - async fn push_release(&mut self, rc: &ReleaseContext) -> Result<()> { + async fn push_release(&mut self, _rc: &ReleaseContext) -> Result<()> { todo!() } - async fn push_release_artifact(&mut self, rc: &ReleaseContext) -> Result<()> { + async fn push_release_artifact(&mut self, _rc: &ReleaseContext) -> Result<()> { todo!() } - async fn push_pkg(&mut self, pc: &PublishContext) -> Result<()> { + async fn push_pkg(&mut self, _pc: &PublishContext) -> Result<()> { todo!() } } diff --git a/src/serverapi/mod.rs b/src/serverapi/mod.rs index 615659c..0128855 100644 --- a/src/serverapi/mod.rs +++ b/src/serverapi/mod.rs @@ -54,7 +54,7 @@ pub async fn init_servers(cfg: &Config) -> Result { } } for api in collection.iter_mut() { - api.init(&cfg).await?; + api.init(cfg).await?; } Ok(collection) }