Logo

Programming-Idioms

History of Idiom 224 > diff from v19 to v20

Edit summary for version 20 by Plecra:
[Rust] Syntax correction

Version 19

2020-07-15, 15:32:43

Version 20

2020-07-15, 15:33:07

Idiom #224 Add element to the beginning of the list

Insert element x at the beginning of list items.

Idiom #224 Add element to the beginning of the list

Insert element x at the beginning of list items.

Extra Keywords
prepend prefix start
Extra Keywords
prepend prefix start
Imports
use std::collections::VecDeque
Imports
use std::collections::VecDeque;
Code
items.push_front(x);
Code
items.push_front(x);
Doc URL
https://doc.rust-lang.org/std/collections/struct.VecDeque.html#method.push_front
Doc URL
https://doc.rust-lang.org/std/collections/struct.VecDeque.html#method.push_front