eclectic icon indicating copy to clipboard operation
eclectic copied to clipboard

Consider making `Collection::Item` `?Sized`

Open apasel422 opened this issue 10 years ago • 0 comments

This would enable node-based collections to directly embed trait objects. For example:

struct Node<T: ?Sized> {
    left: Option<Box<Node<T>>>,
    right: Option<Box<Node<T>>>,
    item: T,
}

pub struct Heap<T: ?Sized> {
    root: Option<Box<Node<T>>>,
}

apasel422 avatar Apr 06 '16 20:04 apasel422