Changed * to a + in list! macro

This commit is contained in:
Egor 2024-05-02 11:01:25 +03:00
parent 8ccc50e6ee
commit 71f8062bc5

View file

@ -15,7 +15,7 @@ impl ListNode {
macro_rules! list { macro_rules! list {
() => { None }; () => { None };
( $first:expr ) => { Some(Box::new(ListNode::new($first))) }; ( $first:expr ) => { Some(Box::new(ListNode::new($first))) };
( $first:expr, $($x:expr),* ) => { ( $first:expr, $($x:expr),+ ) => {
{ {
let mut head = Box::new(ListNode::new($first)); let mut head = Box::new(ListNode::new($first));
let mut tail = &mut head; let mut tail = &mut head;