linera-witty 0.15.17

Generation of WIT compatible host code from Rust code
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Copyright (c) Zefchain Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

//! Conversions with zero-extension.

/// Converts from a type into a wider `Target` type by zero-extending the most significant bits.
pub trait ZeroExtend<Target> {
    /// Converts into the `Target` type by zero-extending the most significant bits.
    fn zero_extend(self) -> Target;
}

impl ZeroExtend<i64> for i32 {
    fn zero_extend(self) -> i64 {
        self as u32 as u64 as i64
    }
}