MCPcopy Create free account
hub / github.com/StudyRust/leetcode_rust / ListNode

Class ListNode

206-reverse-linked-list.rs:3–6  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1// Definition for singly-linked list.
2#[derive(PartialEq, Eq, Clone, Debug)]
3pub struct ListNode {
4 pub val: i32,
5 pub next: Option<Box<ListNode>>
6}
7
8pub fn reverse_list(head: Option<Box<ListNode>>) -> Option<Box<ListNode>> {
9 if head == None || head.as_ref() == None {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected