Deleting a node from singly linked list has the error “cannot move out of borrowed content”
问题 I am making a singly-linked list. When you delete a node, the previous node's next should become the current node's next ( prev->next = curr->next; ) and return data if the index matches. Otherwise, the previous node becomes the current node and the current node becomes the next node ( prev = curr; curr = curr->next; ): struct Node<T> { data: T, next: Option<Box<Node<T>>>, } struct LinkedList<T> { head: Option<Box<Node<T>>>, } impl LinkedList<i64> { fn remove(&mut self, index: usize) -> i64 {