Hello I am trying to get a mutable reference to the last element in the linked list. Since there is no get_mut() on a CursorMut, I currently have to remove the final element of the LinkedList, modify it, then push it back onto the Linked list:
let mut last_fragment = self.frags.back_mut();
let mut last_fragment = last_fragment.remove().unwrap();
last_fragment.as_mut().append(src, len);
self.frags.push_back(last_fragment);
Hello I am trying to get a mutable reference to the last element in the linked list. Since there is no
get_mut()
on aCursorMut
, I currently have to remove the final element of the LinkedList, modify it, then push it back onto the Linked list:Is there a better way to do this? Thanks!