Skip to main content

costly_when

Function costly_when 

Source
pub fn costly_when(
    rule: FieldRule,
    value: impl Into<Value>,
    severity: Severity,
    why: &str,
) -> FieldRule
Expand description

Mark one answer as the costly one.

The shape most of a workspace config actually has: recycle_bin is not dangerous, recycle_bin: false is; fields.*.reify is not expensive, turning it on is. Marking the field would warn on the harmless answer too, and a warning that fires either way is how a reader learns to click through warnings.

No tint, deliberately. A tint is a property of the row, and the row is not dangerous — one of its answers is. The warning belongs to the moment the answer is chosen, which is what the consequence carries.