Skip to content

Commit

Permalink
Update 24. 两两交换链表中的节点 about rust 优化
Browse files Browse the repository at this point in the history
  • Loading branch information
fwqaaq authored Mar 29, 2023
1 parent d2bbea4 commit c835ec0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion problems/0024.两两交换链表中的节点.md
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ impl Solution {
// 递归
impl Solution {
pub fn swap_pairs(head: Option<Box<ListNode>>) -> Option<Box<ListNode>> {
if head == None || head.as_ref().unwrap().next == None {
if head.is_none() || head.as_ref().unwrap().next.is_none() {
return head;
}

Expand Down

0 comments on commit c835ec0

Please sign in to comment.