Skip to content

Commit

Permalink
Merge pull request youngyangyang04#1989 from fwqaaq/master
Browse files Browse the repository at this point in the history
Update 24. 两两交换链表中的节点 about rust 优化
  • Loading branch information
youngyangyang04 authored Jun 29, 2023
2 parents 86bbd55 + 0059953 commit 1d47b74
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 @@ -409,7 +409,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 1d47b74

Please sign in to comment.