mirror of
https://github.com/dnlbauer/xdrfile.git
synced 2026-09-11 14:45:31 +00:00
Added from type info to cast errors
This commit is contained in:
@@ -109,7 +109,7 @@ fn path_to_cstring(path: impl AsRef<Path>) -> Result<CString> {
|
||||
}
|
||||
|
||||
fn to_i32(value: usize, task: ErrorTask) -> Result<i32> {
|
||||
value.try_into().map_err(|e| Error::NumericCastFailed {
|
||||
value.try_into().map_err(|e| Error::CastFromI32Failed {
|
||||
source: e,
|
||||
value,
|
||||
task,
|
||||
@@ -809,7 +809,7 @@ mod tests {
|
||||
Err(e) => e,
|
||||
_ => panic!("Conversion from -1 to u8 succeeded"),
|
||||
};
|
||||
let expected = Error::NumericCastFailed {
|
||||
let expected = Error::CastFromI32Failed {
|
||||
source: try_from_int_err,
|
||||
task: ErrorTask::Write,
|
||||
value: 3_294_967_295_usize,
|
||||
|
||||
Reference in New Issue
Block a user