use crate::layout::Length;
pub trait AsUnit {
#[track_caller]
fn px(self) -> Length;
}
impl AsUnit for f64 {
#[track_caller]
fn px(self) -> Length {
Length::px(self)
}
}
impl AsUnit for f32 {
#[track_caller]
fn px(self) -> Length {
Length::px(self as f64)
}
}
impl AsUnit for u64 {
#[track_caller]
fn px(self) -> Length {
Length::px(self as f64)
}
}
impl AsUnit for u32 {
#[track_caller]
fn px(self) -> Length {
Length::px(self as f64)
}
}
impl AsUnit for u16 {
#[track_caller]
fn px(self) -> Length {
Length::px(self as f64)
}
}
impl AsUnit for u8 {
#[track_caller]
fn px(self) -> Length {
Length::px(self as f64)
}
}
impl AsUnit for i64 {
#[track_caller]
fn px(self) -> Length {
Length::px(self as f64)
}
}
impl AsUnit for i32 {
#[track_caller]
fn px(self) -> Length {
Length::px(self as f64)
}
}
impl AsUnit for i16 {
#[track_caller]
fn px(self) -> Length {
Length::px(self as f64)
}
}
impl AsUnit for i8 {
#[track_caller]
fn px(self) -> Length {
Length::px(self as f64)
}
}