| 810 | Value::new_int(ctx.clone(), value as i32) |
| 811 | }, |
| 812 | NumberKind::Int32 => { |
| 813 | let value = match endian { |
| 814 | Endian::Big => i32::from_be_bytes(bytes.try_into().unwrap()), |
| 815 | Endian::Little => i32::from_le_bytes(bytes.try_into().unwrap()), |
| 816 | }; |
| 817 | Value::new_int(ctx.clone(), value) |
| 818 | }, |
| 819 | NumberKind::UInt32 => { |
| 820 | let value = match endian { |
| 821 | Endian::Big => u32::from_be_bytes(bytes.try_into().unwrap()), |
| 822 | Endian::Little => u32::from_le_bytes(bytes.try_into().unwrap()), |
| 823 | }; |
| 824 | Value::new_float(ctx.clone(), value as f64) |
| 825 | }, |
| 826 | }; |
| 827 | Ok(value) |
| 828 | } |
| 829 | |