difficient 0.1.0

Efficient, type-safe, zero-allocation structural diffing
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use chrono::DateTime;

use crate::{AtomicDiff, Diffable};

impl<'a, Tz: chrono::TimeZone + 'a> Diffable<'a> for DateTime<Tz> {
    type Diff = AtomicDiff<'a, Self>;

    fn diff(&self, other: &'a Self) -> Self::Diff {
        if self == other {
            AtomicDiff::Unchanged
        } else {
            AtomicDiff::Replaced(other)
        }
    }
}