docs: Actually added basic docs. Will be update, I swear

This commit is contained in:
Nickiel12 2022-12-10 22:31:02 -08:00
parent b9a5e5d2b4
commit 407e61976b

View file

@ -4,6 +4,20 @@ use scan_dir::ScanDir;
const SUPPORTED_FILETYPES: [&str; 1] = ["mp3"]; const SUPPORTED_FILETYPES: [&str; 1] = ["mp3"];
/// Recursivly scans the given root directory for files
/// WIP Function! All it does is print the directories
///
/// # Examples
///
/// ```rust
/// scan_music_dir("/home/Documents/RustedBeats");
///
///>>> "I found a directory src at .../src"
///>>> "I found a directory debug at .../debug"
///>>> "I found a file Cargo.toml at .../Cargo.toml"
///...
/// ```
///
pub fn scan_music_dir(root: String) -> Result<(), ()> { pub fn scan_music_dir(root: String) -> Result<(), ()> {
let mut directories = Vec::<PathBuf>::new(); let mut directories = Vec::<PathBuf>::new();
directories.push(root.into()); directories.push(root.into());