Skip to main content

toggle_variant_group

Function toggle_variant_group 

Source
pub fn toggle_variant_group(
    content: &str,
    group: &str,
    force: &Option<String>,
    comment_style: &CommentStyle,
) -> Result<String>
Expand description

Toggle every variant of group in content.

  • force = None and exactly 2 variants → pair-flip (each variant inverted).
  • force = None and 1 variant → solo invert (existing per-section behavior).
  • force = None and 3+ variants → error per PRD §0.13.3.
  • force = Some("on" | "off") → apply force to every variant regardless of count.