linebender/druid

Sameness for fresh clones

Open

#944 geöffnet am 15. Mai 2020

Auf GitHub ansehen
 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Rust (567 Forks)batch import
D-Easydocshelp wanted

Repository-Metriken

Stars
 (9.091 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Would it make sense to add to the doc of Data::same that the following property is recommended (or even required)?

assert!(x.same(&x.clone()))

I'm asking because there were some confusion about how to implement Data::same for im::Vector in https://github.com/bodil/im-rs/issues/117 and https://github.com/bodil/im-rs/issues/129. The current doc of Data::same would even allow the following implementation.

impl Data for Foo {
    fn same(&self, _other: &Self) -> bool {
        false
    }
}

Contributor Guide