tsk-76: Cleanup

This commit is contained in:
2025-10-24 12:40:34 -04:00
parent f66436472a
commit 69423d8d39
3 changed files with 25 additions and 34 deletions

View File

@@ -1,4 +1,8 @@
pub fn concatenate_path(directory: &str, filename: &str, last_index: usize) -> Result<String, std::io::Error> {
pub fn concatenate_path(
directory: &str,
filename: &str,
last_index: usize,
) -> Result<String, std::io::Error> {
if let Some(character) = directory.chars().nth(last_index) {
let buffer: String = if character != '/' {
format!("{directory}/")
@@ -8,6 +12,8 @@ pub fn concatenate_path(directory: &str, filename: &str, last_index: usize) -> R
Ok(format!("{buffer}{filename}"))
} else {
Err(std::io::Error::other(crate::constants::error::LAST_CHARACTER_IN_DIRECTORY))
Err(std::io::Error::other(
crate::constants::error::LAST_CHARACTER_IN_DIRECTORY,
))
}
}