Continuing my Rust Rants :-)
It’s unfortunate that move
is a keyword. As I write my little programs, I found that that’s a common function name I use. Now I need to come up with something else. adjust ?
There’s gotta be a better way…
use std::env;
use std::path::Path;
fn usage(arg: &String) {
let path = Path::new(arg);
println!("usage: {} a b", path.file_name().unwrap().to_str().unwrap());
}
fn main() {
let args = env::args();
if args.len() < 3 {
usage(&args.collect::<Vec<String>>()[0]);
}
}
@joe-lawrence Emacs is more than an operating system. It’s an orchestra.
ANNOUNCE: new releases! trace-cmd 3.1.5 libtracecmd 1.3 libtracefs 1.6.3 libtraceevent 1.7