mmv 0.1.0

lib to mass move files with template names
Documentation
#![forbid(unsafe_code)]

use crate::error_handler::Error;
use std::{fs, path::Path};

pub fn get_file_names_in_directory(directory: &Path) -> Result<Vec<String>, Error> {
    let mut found_file_names = Vec::<String>::new();

    for entry in fs::read_dir(directory)? {
        let path = entry?.path();

        if path.is_dir() {
            continue;
        }

        if let Some(os_path) = path.file_name() {
            found_file_names.push(os_path.to_str().unwrap().to_string());
        }
    }

    match found_file_names.is_empty() {
        true => Err(Error::NoFilesFound),
        false => Ok(found_file_names),
    }
}