
エントリーの編集

エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
Adding an append method to a singly linked list
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています

- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
Adding an append method to a singly linked list
I was looking through the singly linked list example on rustbyexample.com and I noticed the imple... I was looking through the singly linked list example on rustbyexample.com and I noticed the implementation had no append method, so I decided to try and implement it: fn append(self, elem: u32) -> List { let mut node = &self; loop { match *node { Cons(_, ref tail) => { node = tail; }, Nil => { node.prepend(elem); break; }, } } return self; } The above is one of many different attempts, but I canno