Skip to main content

clamp_to_defaults

Function clamp_to_defaults 

Source
pub fn clamp_to_defaults(
    caps: Option<Caps>,
    limits: &Limits,
    before: Option<&Caps>,
) -> (Option<Caps>, Vec<String>)
Expand description

An agent’s caps, held to the defaults: a higher figure becomes the default (only the operator raises a cap, §7). A figure the job already had (before, on an edit) is kept as it is, so an agent changing a job’s brief doesn’t lower a cap the operator raised. Returns the caps to store and, for each figure changed, a sentence for the reply.