fret_runtime/strict_runtime.rs
1use std::ffi::OsString;
2
3fn parse_strict_runtime_value(value: OsString) -> bool {
4 let s = value.to_string_lossy();
5 let s = s.trim();
6 if s.is_empty() {
7 return false;
8 }
9 !matches!(s, "0" | "false" | "no" | "off")
10}
11
12/// Returns whether `FRET_STRICT_RUNTIME` enables strict runtime behavior.
13///
14/// This is intentionally shared across kernel crates so "strict mode" toggles behave consistently.
15pub fn strict_runtime_enabled_from_env() -> bool {
16 std::env::var_os("FRET_STRICT_RUNTIME").is_some_and(parse_strict_runtime_value)
17}