Closed hawkw closed 6 years ago
suspect @amanjeev may want this one.
Thank you for adding me to this repo. I assigned this to myself.
@amanjeev fantastic, I figured you might be interested in this issue! 🙂
I'm trying to add anyone who's made a significant contribution as repo collaborators so they can be assigned to issues and to review PRs. You'll still need approval from me to merge to master. However, when I add a CODEOWNERS file, I'll probably add you as an owner for the singly-linked list module, so you'll automatically be added as a reviewer for that code.
Hehe thank you! I am actually interested in this entire peoject. The name SOS spoke to me. :-)
Does it makes sense to have FromIter
in singly
's case?
I have added it but it I am confused whether it should add in reverse order or not. For the time being I have left it as-is and in the test I have --
...
let mut nlist = UnsafeList::from_iter(list_a.rev()); // adding in reverse on your own...
...
@amanjeev I think that's okay; what I would probably do is add a note in the RustDoc comments for the singly::List
type (i.e. somewhere in here) saying that, as the singly-linked list only provides stack operations, FromIterator
will return a new list in reverse order.
The alternative --- creating a temporary vector to store the iterator's contents in, and then push them in reverse order --- won't work in #[no_std]
environments, since we can't allocate Vec
s, so I think doing it this way is fine, as long as it's documented.
follow-on from #8.
this is going to look pretty similar to the code I added in a15318754af30f1ffc64c1f40a8f77d217ad324d.