Refactor: Construct IoError from std::io::Error instead of std::io::ErrorKind (#15777)

This commit is contained in:
Piepmatz
2025-05-18 14:52:40 +02:00
committed by GitHub
parent c4dcfdb77b
commit 833471241a
80 changed files with 408 additions and 299 deletions

View File

@ -107,14 +107,14 @@ impl Command for Do {
let mut buf = Vec::new();
stdout.read_to_end(&mut buf).map_err(|err| {
IoError::new_internal(
err.kind(),
err,
"Could not read stdout to end",
nu_protocol::location!(),
)
})?;
Ok::<_, ShellError>(buf)
})
.map_err(|err| IoError::new(err.kind(), head, None))
.map_err(|err| IoError::new(err, head, None))
})
.transpose()?;
@ -126,7 +126,7 @@ impl Command for Do {
let mut buf = String::new();
stderr
.read_to_string(&mut buf)
.map_err(|err| IoError::new(err.kind(), span, None))?;
.map_err(|err| IoError::new(err, span, None))?;
buf
}
};