♻️ refactor(utils): improve config directory handling
- use Result alias for better readability - simplify error handling with early return
This commit is contained in:
committed by
Jeremiah Russell
parent
ca1ab60c50
commit
9e5c6e1bc8
@@ -1,8 +1,8 @@
|
||||
use std::{env, fs, io};
|
||||
|
||||
use crate::Error;
|
||||
use crate::{Error, Result};
|
||||
|
||||
pub(crate) fn assure_config_dir_exists(dir: &str) -> Result<String, Error> {
|
||||
pub(crate) fn assure_config_dir_exists(dir: &str) -> Result<String> {
|
||||
let trdir = dir.trim();
|
||||
if trdir.is_empty() {
|
||||
return Err(Error::DirectoryUnset);
|
||||
|
||||
Reference in New Issue
Block a user