Interpret an extension request-label value. Accepts the explicit `enabled`/`requested` spellings as well as the common bool-like values understood by [`parse_bool_like`]; anything unrecognized is treated as "not requested" so a malformed label fails closed.
(value: &str)
| 673 | /// understood by [`parse_bool_like`]; anything unrecognized is treated as |
| 674 | /// "not requested" so a malformed label fails closed. |
| 675 | fn extension_label_enabled(value: &str) -> bool { |
| 676 | let normalized = value.trim().to_ascii_lowercase(); |
| 677 | if matches!( |
| 678 | normalized.as_str(), |
| 679 | "enabled" | "enable" | "requested" | "request" |
| 680 | ) { |
| 681 | return true; |
| 682 | } |
| 683 | if matches!(normalized.as_str(), "disabled" | "disable") { |
| 684 | return false; |
| 685 | } |
| 686 | parse_bool_like(&normalized).unwrap_or(false) |
| 687 | } |
| 688 | |
| 689 | fn warn_on_singleton_overwrite<T>( |
| 690 | extension_name: &str, |
no test coverage detected