From 19d5d11b0506dcf9511d8260cc8a39eb6b6baf0a Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Sat, 24 Feb 2024 12:28:29 +0000 Subject: [PATCH] automatic cargo CI changes --- src/config/mod.rs | 8 ++------ src/config/packages.rs | 2 +- src/release/mod.rs | 2 +- src/serverapi/forgejo.rs | 9 ++++----- src/serverapi/gitea.rs | 8 ++++---- src/serverapi/github.rs | 8 ++++---- src/serverapi/gitlab.rs | 8 ++++---- 7 files changed, 20 insertions(+), 25 deletions(-) diff --git a/src/config/mod.rs b/src/config/mod.rs index 0e5e7b9..b1d0916 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -10,7 +10,6 @@ use crate::error::*; pub mod cli; pub mod packages; use cli::Cli; -use packages::*; pub trait YamlConfigSection: Debug + Clone + for<'a> Deserialize<'a> { fn check(&self) -> Result<()>; @@ -65,7 +64,7 @@ impl Pass { self.check()?; Ok(match self { Self::Text(pass) => pass.clone(), - Self::Env(key) => std::env::var(key).map_err(|err| ConfigError::from(err))?, + Self::Env(key) => std::env::var(key).map_err(ConfigError::from)?, Self::File(file) => std::fs::read_to_string(file)?, }) } @@ -75,10 +74,7 @@ impl YamlConfigSection for Pass { match self { Self::Text(_) => (), Self::Env(envvar) => { - if !std::env::var(envvar) - .map_err(ConfigError::from)? - .is_empty() - { + if !std::env::var(envvar).map_err(ConfigError::from)?.is_empty() { } else { return Err(ConfigError::EnvNotSet(envvar.clone()).into()); } diff --git a/src/config/packages.rs b/src/config/packages.rs index bcbf9b6..19db680 100644 --- a/src/config/packages.rs +++ b/src/config/packages.rs @@ -1,3 +1,3 @@ pub enum PackageType { - Cargo + Cargo, } diff --git a/src/release/mod.rs b/src/release/mod.rs index 9c8eee9..2aac8c4 100644 --- a/src/release/mod.rs +++ b/src/release/mod.rs @@ -22,6 +22,6 @@ pub async fn release(cfg: &Config, apis: &mut ApiCollection) -> Result<()> { Ok(()) } -async fn tag(cfg: &Config) -> Result<()> { +async fn tag(_cfg: &Config) -> Result<()> { todo!() } diff --git a/src/serverapi/forgejo.rs b/src/serverapi/forgejo.rs index 011eeba..8a7db91 100644 --- a/src/serverapi/forgejo.rs +++ b/src/serverapi/forgejo.rs @@ -2,14 +2,14 @@ use async_trait::async_trait; use super::ServerApi; use crate::{ - config::{packages::PackageType, ApiType, Config}, + config::{packages::PackageType, Config}, error::*, }; pub struct 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) -> Result<()> { @@ -18,14 +18,13 @@ impl ServerApi for Forgejo { async fn push_release_artifact(&mut self) -> Result<()> { todo!() } - async fn push_pkg(&mut self, pkg_type: PackageType) -> Result<()> { + async fn push_pkg(&mut self, _pkg_type: PackageType) -> Result<()> { todo!() } - } impl Forgejo { - pub async fn build(cfg: &Config) -> Result { + pub async fn build(_cfg: &Config) -> Result { todo!() } } diff --git a/src/serverapi/gitea.rs b/src/serverapi/gitea.rs index 425fd74..a69eb32 100644 --- a/src/serverapi/gitea.rs +++ b/src/serverapi/gitea.rs @@ -2,14 +2,14 @@ use async_trait::async_trait; use super::ServerApi; use crate::{ - config::{packages::PackageType, ApiType, Config}, + config::{packages::PackageType, Config}, error::*, }; 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) -> Result<()> { @@ -18,13 +18,13 @@ impl ServerApi for Gitea { async fn push_release_artifact(&mut self) -> Result<()> { todo!() } - async fn push_pkg(&mut self, pkg_type: PackageType) -> Result<()> { + async fn push_pkg(&mut self, _pkg_type: PackageType) -> Result<()> { todo!() } } impl Gitea { - pub async fn build(cfg: &Config) -> Result { + pub async fn build(_cfg: &Config) -> Result { todo!() } } diff --git a/src/serverapi/github.rs b/src/serverapi/github.rs index 1456dff..aeb5548 100644 --- a/src/serverapi/github.rs +++ b/src/serverapi/github.rs @@ -2,14 +2,14 @@ use async_trait::async_trait; use super::ServerApi; use crate::{ - config::{packages::PackageType, ApiType, Config}, + config::{packages::PackageType, Config}, error::*, }; 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) -> Result<()> { @@ -18,13 +18,13 @@ impl ServerApi for Github { async fn push_release_artifact(&mut self) -> Result<()> { todo!() } - async fn push_pkg(&mut self, pkg_type: PackageType) -> Result<()> { + async fn push_pkg(&mut self, _pkg_type: PackageType) -> Result<()> { todo!() } } impl Github { - pub async fn build(cfg: &Config) -> Result { + pub async fn build(_cfg: &Config) -> Result { todo!() } } diff --git a/src/serverapi/gitlab.rs b/src/serverapi/gitlab.rs index fc330bd..d80120d 100644 --- a/src/serverapi/gitlab.rs +++ b/src/serverapi/gitlab.rs @@ -2,14 +2,14 @@ use async_trait::async_trait; use super::ServerApi; use crate::{ - config::{packages::PackageType, ApiType, Config}, + config::{packages::PackageType, Config}, error::*, }; 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) -> Result<()> { @@ -18,13 +18,13 @@ impl ServerApi for Gitlab { async fn push_release_artifact(&mut self) -> Result<()> { todo!() } - async fn push_pkg(&mut self, pkg_type: PackageType) -> Result<()> { + async fn push_pkg(&mut self, _pkg_type: PackageType) -> Result<()> { todo!() } } impl Gitlab { - pub async fn build(cfg: &Config) -> Result { + pub async fn build(_cfg: &Config) -> Result { todo!() } }