forked from kemitix/git-next
chore: cargo clippy fixes
This commit is contained in:
parent
cb46138cdc
commit
cd8d236940
3 changed files with 8 additions and 7 deletions
|
@ -2,7 +2,7 @@ use std::path::PathBuf;
|
||||||
|
|
||||||
use crate::filesystem::FileSystem;
|
use crate::filesystem::FileSystem;
|
||||||
|
|
||||||
pub(crate) fn run(fs: FileSystem) {
|
pub fn run(fs: FileSystem) {
|
||||||
let file_name = ".git-next.toml";
|
let file_name = ".git-next.toml";
|
||||||
let path = PathBuf::from(file_name);
|
let path = PathBuf::from(file_name);
|
||||||
if fs.file_exists(&path) {
|
if fs.file_exists(&path) {
|
||||||
|
|
|
@ -3,8 +3,8 @@ use terrors::OneOf;
|
||||||
|
|
||||||
use crate::filesystem::FileSystem;
|
use crate::filesystem::FileSystem;
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Deserialize)]
|
#[derive(Debug, PartialEq, Eq, Deserialize)]
|
||||||
pub(crate) struct Config {
|
pub struct Config {
|
||||||
r#type: ForgeType,
|
r#type: ForgeType,
|
||||||
url: String,
|
url: String,
|
||||||
user: String,
|
user: String,
|
||||||
|
@ -12,14 +12,15 @@ pub(crate) struct Config {
|
||||||
// Private SSH Key Path
|
// Private SSH Key Path
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Deserialize)]
|
#[derive(Debug, PartialEq, Eq, Deserialize)]
|
||||||
pub(crate) enum ForgeType {
|
pub enum ForgeType {
|
||||||
ForgeJo,
|
ForgeJo,
|
||||||
// Gitea,
|
// Gitea,
|
||||||
// GitHub,
|
// GitHub,
|
||||||
// GitLab,
|
// GitLab,
|
||||||
// BitBucket,
|
// BitBucket,
|
||||||
}
|
}
|
||||||
|
#[allow(dead_code)]
|
||||||
impl Config {
|
impl Config {
|
||||||
pub(crate) fn load(fs: &FileSystem) -> Result<Self, OneOf<(std::io::Error, toml::de::Error)>> {
|
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)?;
|
let str = fs.read_file("git-next-server.toml").map_err(OneOf::new)?;
|
||||||
|
|
|
@ -6,7 +6,7 @@ use tracing::info;
|
||||||
|
|
||||||
use crate::filesystem::FileSystem;
|
use crate::filesystem::FileSystem;
|
||||||
|
|
||||||
pub(crate) fn init(fs: FileSystem) {
|
pub fn init(fs: FileSystem) {
|
||||||
let file_name = "git-next-server.toml";
|
let file_name = "git-next-server.toml";
|
||||||
let path = PathBuf::from(file_name);
|
let path = PathBuf::from(file_name);
|
||||||
if fs.file_exists(&path) {
|
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 {
|
let Ok(_) = init_logging() else {
|
||||||
eprintln!("Failed to initialize logging.");
|
eprintln!("Failed to initialize logging.");
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue