Closed khrs closed 7 years ago
Can you elaborate on why it is needed? What does it bring to the table?
Just convention. We shouldn't "push" new elements to "factors" after Plan::new() finish So we can enforce it using Box<_> Just cosmetics.
How can one push new elements into a plan?
You cannot from outside code. As I said just cosmetics.
This change makes the code less intelligible without a good reason.
I don't agree here. You use Vec<_> when you want "dynamic sized array" If you algorithm build "factors" in Plan::new() then you wanted to add/remove some "factors" later in your algo Vec<_> is fine. But in this case you build it once in Plan::new() and you never should add/remove elements from "factors" later in your algo. So we can enforce that you never add/remove smth accidentally from "factors" using Box<_> instead of Vec<_>. But it's just cosmetics.
We are not allowed to modify it after creation anyway. So let's enforce it.