Skip to main content

wasmtime_internal_core/
truncate.rs

1//! Explicit methods to clearly indicate that truncation is desired when used.
2
3/// Explicitly truncate an `i32` to an `i16`.
4pub fn truncate_i32_to_i16(a: i32) -> i16 {
5    a as i16
6}
7
8/// Explicitly truncate an `i32` to an `i8`.
9pub fn truncate_i32_to_i8(a: i32) -> i8 {
10    a as i8
11}