rust/hwphysics/src/common.rs
changeset 15780 f4b563a9ac5e
parent 15383 701ad89a9f2a
equal deleted inserted replaced
15778:50315e39d705 15780:f4b563a9ac5e
     7 #[repr(transparent)]
     7 #[repr(transparent)]
     8 pub struct Millis(u32);
     8 pub struct Millis(u32);
     9 
     9 
    10 impl Millis {
    10 impl Millis {
    11     #[inline]
    11     #[inline]
    12     pub fn new(value: u32) -> Self {
    12     pub const fn new(value: u32) -> Self {
    13         Self(value)
    13         Self(value)
    14     }
    14     }
    15 
    15 
    16     #[inline]
    16     #[inline]
    17     pub fn get(self) -> u32 {
    17     pub const fn get(self) -> u32 {
    18         self.0
    18         self.0
    19     }
    19     }
    20 
    20 
    21     #[inline]
    21     #[inline]
    22     pub fn to_fixed(self) -> FPNum {
    22     pub fn to_fixed(self) -> FPNum {