mirror of
https://github.com/NotAShelf/microfetch.git
synced 2025-10-09 22:42:04 +00:00
perf: don't collect args into a Vec
This commit is contained in:
parent
9713138e94
commit
88c9ff5e13
1 changed files with 1 additions and 2 deletions
|
@ -12,8 +12,7 @@ use crate::uptime::get_current;
|
||||||
use std::io::{Write, stdout};
|
use std::io::{Write, stdout};
|
||||||
|
|
||||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
let args: Vec<String> = std::env::args().collect();
|
if Some("--version") == std::env::args().nth(1).as_deref() {
|
||||||
if args.len() > 1 && args[1] == "--version" {
|
|
||||||
println!("Microfetch {}", env!("CARGO_PKG_VERSION"));
|
println!("Microfetch {}", env!("CARGO_PKG_VERSION"));
|
||||||
} else {
|
} else {
|
||||||
let utsname = nix::sys::utsname::uname()?;
|
let utsname = nix::sys::utsname::uname()?;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue