#![forbid(unsafe_code)]
pub mod cli;
pub mod model;
pub(crate) mod apply;
pub(crate) mod clean;
pub(crate) mod config;
pub(crate) mod doctor;
pub(crate) mod health;
pub(crate) mod normalize;
pub(crate) mod output;
pub(crate) mod path_env;
pub(crate) mod platform;
pub(crate) mod policy;
pub(crate) mod profile_scan;
pub(crate) mod resolve;
pub(crate) mod why_not;
#[cfg(feature = "fuzzing")]
pub mod fuzzing {
use crate::clean;
use crate::doctor;
use crate::model::{DoctorReport, PathEntry, PlatformMode, ShellKind};
use crate::output::json;
use crate::path_env;
#[must_use]
pub fn clean_path(
path_value: &str,
platform_mode: PlatformMode,
pathext: Option<&str>,
) -> String {
clean::clean_path(path_value, platform_mode, pathext)
}
#[must_use]
pub fn clean_export(
path_value: &str,
platform_mode: PlatformMode,
pathext: Option<&str>,
shell: ShellKind,
) -> String {
clean::clean_export(path_value, platform_mode, pathext, shell)
}
#[must_use]
pub fn parse_path(
path_value: &str,
platform_mode: PlatformMode,
pathext: Option<&str>,
) -> Vec<PathEntry> {
path_env::parse_path(path_value, platform_mode, pathext)
}
#[must_use]
pub fn diagnose_path(
path_value: &str,
platform_mode: PlatformMode,
pathext: Option<&str>,
) -> DoctorReport {
doctor::diagnose_path(path_value, platform_mode, pathext)
}
pub fn print_json(entries: &[PathEntry]) -> Result<String, serde_json::Error> {
json::dumps_json(&json::entries_to_json(entries))
}
pub fn doctor_json(report: &DoctorReport) -> Result<String, serde_json::Error> {
json::dumps_json(&json::doctor_to_json(report))
}
#[cfg(test)]
#[path = "tests.rs"]
mod tests;
}