rust/pv_core: Fix error type of misc::read_file

Was Write, should be Read.

Fixes: 9b51b8b882 ("rust/pv: Refactor pv crate")
Signed-off-by: Jakob Naucke <naucke@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Jakob Naucke
2025-01-31 18:05:50 +01:00
committed by Jan Höppner
parent a32adbf5d8
commit a9fbfcc7ae

View File

@@ -296,7 +296,7 @@ pub fn read_file<P: AsRef<Path>>(path: P, ctx: &str) -> Result<Vec<u8>> {
pub fn read<R: Read, P: AsRef<Path>>(rd: &mut R, path: P, ctx: &str) -> Result<Vec<u8>> {
let mut buf = vec![];
rd.read_to_end(&mut buf).map_err(|e| Error::FileIo {
ty: FileIoErrorType::Write,
ty: FileIoErrorType::Read,
ctx: ctx.to_string(),
path: path.as_ref().to_path_buf(),
source: e,