23 lines
311 B
Rust
23 lines
311 B
Rust
#[const_trait]
|
|
pub trait UiNum {
|
|
fn to_f32(self) -> f32;
|
|
}
|
|
|
|
impl const UiNum for f32 {
|
|
fn to_f32(self) -> f32 {
|
|
self
|
|
}
|
|
}
|
|
|
|
impl const UiNum for u32 {
|
|
fn to_f32(self) -> f32 {
|
|
self as f32
|
|
}
|
|
}
|
|
|
|
impl const UiNum for i32 {
|
|
fn to_f32(self) -> f32 {
|
|
self as f32
|
|
}
|
|
}
|