1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00

logname: fix test & style warning

This commit is contained in:
Idan Attias 2021-05-06 11:59:58 +03:00 committed by Sylvestre Ledru
parent 41eb930292
commit 34b9809223

View file

@ -37,21 +37,20 @@ static SUMMARY: &str = "Print user's login name";
static VERSION: &str = env!("CARGO_PKG_VERSION");
fn get_usage() -> String {
format!("{0}", executable!())
String::from(executable!())
}
pub fn uumain(args: impl uucore::Args) -> i32 {
let _ = args
let args = args
.collect_str(InvalidEncodingHandling::Ignore)
.accept_any();
let usage = get_usage();
let _ = App::new(executable!())
.version(VERSION)
.about(SUMMARY)
.usage(&usage[..])
.get_matches();
.get_matches_from(args);
match get_userlogin() {
Some(userlogin) => println!("{}", userlogin),