Summary
Modify the current CatalystSignedDocumentValidationRule::check interface to the following one
pub trait CatalystSignedDocumentValidationRule {
/// Validates `CatalystSignedDocument`, properly fill the problem report if
/// `CatalystSignedDocument` violates some validation rules.
/// So `doc.report().is_problematic()` would return `false`.
///
/// # Errors
/// If `provider` returns error, fails fast throwing that error.
fn check(
&self,
doc: &CatalystSignedDocument,
provider: &dyn Provider,
) -> anyhow::Result<()>;
}
Such improvement would reduce implementation complexity and as a result maintainability, because by properly filling the document's problem report already solves the problem to identifying is the document valid or not.
Summary
Modify the current
CatalystSignedDocumentValidationRule::checkinterface to the following oneSuch improvement would reduce implementation complexity and as a result maintainability, because by properly filling the document's problem report already solves the problem to identifying is the document valid or not.