Logo

Programming-Idioms

History of Idiom 19 > diff from v36 to v37

Edit summary for version 37 by GobbleCock:
New Rust implementation by user [GobbleCock]

Version 36

2018-03-13, 22:16:34

Version 37

2018-06-11, 19:36:54

Idiom #19 Reverse a list

Reverse the order of the elements of list x .
This may reverse "in-place" and destroy the original ordering.

Idiom #19 Reverse a list

Reverse the order of the elements of list x .
This may reverse "in-place" and destroy the original ordering.

Code
let mut x = vec![1,2,3];
x.reverse();
Doc URL
https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#method.reserve
Origin
https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#examples-5
Demo URL
https://play.rust-lang.org/?gist=288d534d236a3e01f27858ead009d988&version=stable&mode=debug