Skip to content

Instantly share code, notes, and snippets.

View cgwalters's full-sized avatar
👍
LGTM

Colin Walters cgwalters

👍
LGTM
View GitHub Profile
@cgwalters
cgwalters / playground.rs
Created June 10, 2018 12:59 — forked from rust-play/playground.rs
Code shared from the Rust Playground
fn f<T: AsRef<str>>(args: &[T])
{
let bargv = &["foo", "bar"];
let nargv : Vec<&str> = bargv.iter().map(|&v|v).chain(args.iter().map(AsRef::as_ref)).collect();
println!("{:?}", nargv);
}
fn main() {
let args : Vec<String> = std::env::args().collect();
f(&args);