Logo

Programming-Idioms

History of Idiom 19 > diff from v37 to v38

Edit summary for version 38 by programming-idioms.org:
[Rust] No sample values

Version 37

2018-06-11, 19:36:54

Version 38

2018-08-03, 20:35:13

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();
Code
x.reverse();
Doc URL
https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#method.reserve
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
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
Demo URL
https://play.rust-lang.org/?gist=288d534d236a3e01f27858ead009d988&version=stable&mode=debug