Pure form of the gate for tests: env override beats the config flag.
(env_value: Option<&str>, config_flag: bool)
| 68 | |
| 69 | /// Pure form of the gate for tests: env override beats the config flag. |
| 70 | pub fn injection_enabled_from(env_value: Option<&str>, config_flag: bool) -> bool { |
| 71 | match env_value { |
| 72 | Some(value) => !matches!( |
| 73 | value.trim().to_ascii_lowercase().as_str(), |
| 74 | "0" | "false" | "off" | "no" |
| 75 | ), |
| 76 | None => config_flag, |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | // --------------------------------------------------------------------------- |
| 81 | // Sanitization |
no outgoing calls
no test coverage detected