As per the documentation of unit type (), it implements Extend trait.

fn extend<T>(&mut self, iter: T) 
where
    T: IntoIterator<Item = ()>, 

Extends a collection with the contents of an iterator.

But I don’t really understand the use of it. This allowed me to do the following:

fn main() {
    let mut r = ();
    println!("{:?}", r); // print `()`
    r.extend(vec![(), ()]);
    println!("{:?}", r); // This also print `()`
}

But it does not make any sense to me. So my question is why unit type implements Extend trait ?

1