chore: cargo clippy fixes

This commit is contained in:
Paul Campbell 2024-04-07 16:09:16 +01:00
parent cb46138cdc
commit cd8d236940
3 changed files with 8 additions and 7 deletions

View file

@ -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) {

View file

@ -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<Self, OneOf<(std::io::Error, toml::de::Error)>> {
let str = fs.read_file("git-next-server.toml").map_err(OneOf::new)?;

View file

@ -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;