pub enum OnProblems {
FailOnError,
FailOnAny,
WarnOnly,
Ignore,
}Expand description
What to do when crate::lint returns findings.
Pass to handle_problems or, more commonly, let crate::contract!’s
generated Model::parse_and_lint handle both steps at once.
Variants§
FailOnError
Print errors and warnings to stderr; exit with status 1 on any error. Warnings alone are printed but do not stop the program.
This is the right default for most programs: a misspelled flag is an error (the intent is clear but wrong), an unknown env var is a warning (it might just be a coincidence).
FailOnAny
Print all findings to stderr; exit with status 1 if there is anything at all — errors or warnings.
Use this when warnings are unacceptable: a strict tool, a CI step, or a program where an unrecognised env var is never a coincidence.
WarnOnly
Print all findings to stderr; never exit because of them.
Use this for programs that want to surface problems without stopping, or for a startup phase where the caller handles the exit itself.
Ignore
Discard all findings silently.
Use this only when you have already handled findings yourself, or when the program genuinely cannot do anything useful with them.