Skip to content

Commit

Permalink
simple-linked-list: clarify vector order
Browse files Browse the repository at this point in the history
  • Loading branch information
senekor committed Aug 16, 2024
1 parent d47d407 commit 45ccd6f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions exercises/practice/simple-linked-list/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ impl<T> FromIterator<T> for SimpleLinkedList<T> {
// In general, it would be preferable to implement IntoIterator for SimpleLinkedList<T>
// instead of implementing an explicit conversion to a vector. This is because, together,
// FromIterator and IntoIterator enable conversion between arbitrary collections.
// Given that implementation, converting to a vector is trivial:
//
// let vec: Vec<_> = simple_linked_list.into_iter().collect();
//
// The reason this exercise's API includes an explicit conversion to Vec<T> instead
// of IntoIterator is that implementing that interface is fairly complicated, and
// demands more of the student than we expect at this point in the track.
//
// Please note that the "front" of the linked list should correspond to the "back"
// of the vector as far as the tests are concerned.

impl<T> From<SimpleLinkedList<T>> for Vec<T> {
fn from(mut _linked_list: SimpleLinkedList<T>) -> Vec<T> {
Expand Down

0 comments on commit 45ccd6f

Please sign in to comment.