df3 0.1.2

Advanced disk free utility - modern alternative to df command
Documentation
// File: src\utils.rs
// Author: Hadi Cahyadi <cumulus13@gmail.com>
// Date: 2026-06-16
// Description:
// License: MIT

use std::path::Path;

pub fn is_windows() -> bool {
    cfg!(target_os = "windows")
}

pub fn is_unix() -> bool {
    cfg!(unix)
}

pub fn normalize_path(path: &Path) -> String {
    if is_windows() {
        path.display().to_string().replace('\\', "/")
    } else {
        path.display().to_string()
    }
}

pub fn get_user_home() -> Option<std::path::PathBuf> {
    dirs::home_dir()
}