Skip to main content

diff_effect_only

Function diff_effect_only 

Source
pub fn diff_effect_only(
    old: &Statute,
    new: &Statute,
) -> DiffResult<Option<Change>>
Expand description

Compares only the effect of two statutes.

§Examples

use legalis_core::{Statute, Effect, EffectType};
use legalis_diff::diff_effect_only;

let old = Statute::new("law", "Title", Effect::new(EffectType::Grant, "Old benefit"));
let new = Statute::new("law", "Title", Effect::new(EffectType::Grant, "New benefit"));

let change = diff_effect_only(&old, &new).unwrap();
assert!(change.is_some());

§Errors

Returns DiffError::IdMismatch if the statute IDs don’t match.