mirror of
https://github.com/sharkdp/hexyl.git
synced 2026-10-26 20:16:34 +00:00
1 parent
e888021a48
commit
421bd73ec1
3 files changed
+4
-5
No files matched your search
+2
-3
@@ -2,8 +2,6 @@ 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>),
|
||||
@@ -37,7 +35,8 @@ impl<'a> Seek for Input<'a> {
|
||||
match *self {
|
||||
Input::File(ref mut file) => {
|
||||
let seek_res = file.seek(pos);
|
||||
if let Err(Some(Errno::SPIPE)) = seek_res.as_ref().map_err(Errno::from_io_error) {
|
||||
if let Err(Some(libc::ESPIPE)) = seek_res.as_ref().map_err(|err| err.raw_os_error())
|
||||
{
|
||||
try_skip(
|
||||
file,
|
||||
pos,
|
||||
|
||||
Reference in new issue
Block a user