Skip to content

U types do not convert to each other #568

@rakanalh

Description

@rakanalh

Hello,

Is there a reason why U* types do not implement From/Into from each other? At least to be able to cast upwards.

Example,

impl From<U64> for U128 {
    fn from(num: U64) -> Self {
        num.low_u64().into() // U128 implements From<u64>
    }
}

impl From<U64> for U256 {
    fn from(num: U64) -> Self {
        num.low_u64().into() // U256 implements From<u64>
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions