Merge pull request #180 from sharifhsn/altdeps

Replace outdated dependencies
This commit is contained in:
David Peter authored and GitHub committed 2022-12-05 09:03:40 +01:00
commit f8601e5bc9
4 files changed
+36 -81

No files matched your search

+2 -2
View File
@@ -9,7 +9,7 @@ use std::num::{NonZeroI64, NonZeroU64, NonZeroU8};
use clap::builder::ArgPredicate;
use clap::{crate_name, crate_version, Arg, ArgAction, ColorChoice, Command};
use atty::Stream;
use is_terminal::IsTerminal;
use anyhow::{anyhow, Context, Error as AnyhowError};
@@ -293,7 +293,7 @@ fn run() -> Result<(), AnyhowError> {
let show_color = match matches.get_one::<String>("color").map(String::as_ref) {
Some("never") => false,
Some("auto") => atty::is(Stream::Stdout),
Some("auto") => std::io::stdout().is_terminal(),
_ => true,
};
+3 -2
View File
@@ -2,6 +2,8 @@ use std::convert::TryFrom;
use std::fs;
use std::io::{self, copy, sink, Read, Seek, SeekFrom};
use rustix::io::Errno;
pub enum Input<'a> {
File(fs::File),
Stdin(io::StdinLock<'a>),
@@ -35,8 +37,7 @@ impl<'a> Seek for Input<'a> {
match *self {
Input::File(ref mut file) => {
let seek_res = file.seek(pos);
if let Err(Some(libc::ESPIPE)) = seek_res.as_ref().map_err(|err| err.raw_os_error())
{
if let Err(Some(Errno::SPIPE)) = seek_res.as_ref().map_err(Errno::from_io_error) {
try_skip(
file,
pos,