rust-scraper / ego-tree

Vec-backed ID-tree
https://docs.rs/ego-tree
ISC License
45 stars 16 forks source link

Why do you not use derive? #8

Closed RazrFalcon closed 6 years ago

RazrFalcon commented 6 years ago

It will simplify the code a lot.

causal-agent commented 6 years ago

The non-derive implementations on Tree are to handle the id. The other ones, mostly on NodeId, are because the implementations don't actually depend on T. For example, the code has impl<T> Clone for NodeId<T>, but #[derive(Clone)] would generate impl<T: Clone> Clone for NodeId<T>.

RazrFalcon commented 6 years ago

I see. Makes sense.