linebender/druid

Sameness for fresh clones

Open

#944 ouverte le 15 mai 2020

Voir sur GitHub
 (2 commentaires) (0 réactions) (0 assignés)Rust (567 forks)batch import
D-Easydocshelp wanted

Métriques du dépôt

Stars
 (9 091 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

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
    }
}

Guide contributeur