From d87b5d095870cb0874629ebcda13f069e1c4014f Mon Sep 17 00:00:00 2001 From: emma Date: Mon, 18 Mar 2024 21:31:25 -0600 Subject: [PATCH] hru(1), fop(1): changed to reflect strerror changes --- src/fop.rs | 8 ++++---- src/hru.rs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/fop.rs b/src/fop.rs index 65ee738..b829602 100644 --- a/src/fop.rs +++ b/src/fop.rs @@ -27,7 +27,7 @@ extern crate strerror; extern crate sysexits; use getopt::{ Opt, Parser }; -use strerror::raw_message; +use strerror::StrError; use sysexits::{ EX_DATAERR, EX_IOERR, EX_UNAVAILABLE, EX_USAGE }; fn main() { @@ -77,7 +77,7 @@ fn main() { .stdout(Stdio::piped()) .spawn() .unwrap_or_else( |e| { - eprintln!("{}: {}: {}", argv[0], argv[command_arg], raw_message(e)); + eprintln!("{}: {}: {}", argv[0], argv[command_arg], e.strerror()); exit(EX_UNAVAILABLE); }); @@ -96,7 +96,7 @@ fn main() { } let output = spawned.wait_with_output().unwrap_or_else(|e| { - eprintln!("{}: {}: {}", argv[0], argv[command_arg], raw_message(e)); + eprintln!("{}: {}: {}", argv[0], argv[command_arg], e.strerror()); exit(EX_IOERR); }); @@ -114,7 +114,7 @@ fn main() { stdout().write_all( fields.join(&d.to_string()).as_bytes() ).unwrap_or_else(|e| { - eprintln!("{}: {}", argv[0], raw_message(e)); + eprintln!("{}: {}", argv[0], e.strerror()); exit(EX_IOERR); }); } diff --git a/src/hru.rs b/src/hru.rs index 29e1e49..b7937f7 100644 --- a/src/hru.rs +++ b/src/hru.rs @@ -26,7 +26,7 @@ use std::{ extern crate strerror; extern crate sysexits; -use strerror::raw_message; +use strerror::StrError; use sysexits::{ EX_DATAERR, EX_IOERR, EX_SOFTWARE }; const LIST: [(u32, &str); 10] = [ @@ -100,7 +100,7 @@ fn main() -> ExitCode { stdout().write_all(format!("{} {}\n", out, si_prefix).as_bytes()) .unwrap_or_else(|e| { - eprintln!("{}: {}", argv[0], raw_message(e)); + eprintln!("{}: {}", argv[0], e.strerror()); exit(EX_IOERR); }); }