From cd8d2369409cfcfb2bc349fb3402ae627885213d Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sun, 7 Apr 2024 16:09:16 +0100 Subject: [PATCH] chore: cargo clippy fixes --- src/init.rs | 2 +- src/server/config.rs | 9 +++++---- src/server/mod.rs | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/init.rs b/src/init.rs index 62b8d32..a03e15d 100644 --- a/src/init.rs +++ b/src/init.rs @@ -2,7 +2,7 @@ use std::path::PathBuf; use crate::filesystem::FileSystem; -pub(crate) fn run(fs: FileSystem) { +pub fn run(fs: FileSystem) { let file_name = ".git-next.toml"; let path = PathBuf::from(file_name); if fs.file_exists(&path) { diff --git a/src/server/config.rs b/src/server/config.rs index dd401c3..5fb6c90 100644 --- a/src/server/config.rs +++ b/src/server/config.rs @@ -3,8 +3,8 @@ use terrors::OneOf; use crate::filesystem::FileSystem; -#[derive(Debug, PartialEq, Deserialize)] -pub(crate) struct Config { +#[derive(Debug, PartialEq, Eq, Deserialize)] +pub struct Config { r#type: ForgeType, url: String, user: String, @@ -12,14 +12,15 @@ pub(crate) struct Config { // Private SSH Key Path } -#[derive(Debug, PartialEq, Deserialize)] -pub(crate) enum ForgeType { +#[derive(Debug, PartialEq, Eq, Deserialize)] +pub enum ForgeType { ForgeJo, // Gitea, // GitHub, // GitLab, // BitBucket, } +#[allow(dead_code)] impl Config { pub(crate) fn load(fs: &FileSystem) -> Result> { let str = fs.read_file("git-next-server.toml").map_err(OneOf::new)?; diff --git a/src/server/mod.rs b/src/server/mod.rs index a4050fa..c08342d 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -6,7 +6,7 @@ use tracing::info; use crate::filesystem::FileSystem; -pub(crate) fn init(fs: FileSystem) { +pub fn init(fs: FileSystem) { let file_name = "git-next-server.toml"; let path = PathBuf::from(file_name); if fs.file_exists(&path) { @@ -24,7 +24,7 @@ pub(crate) fn init(fs: FileSystem) { } } -pub(crate) fn start(fs: FileSystem) { +pub fn start(fs: FileSystem) { let Ok(_) = init_logging() else { eprintln!("Failed to initialize logging."); return;