1 type Size = struct 2 width : u32 3 height : u32 4 5 def to_string = "$width, $height" 6 7 type Thickness = struct 8 left : u32 9 right : u32 10 up : u32 11 down : u32 12 13 type Bounds = struct 14 left : u32 15 right : u32 16 up : u32 17 down : u32 18 19 type Rect = struct 20 x : i32 21 y : i32 22 width : u32 23 height : u32 24 25 def ceil_to_power_of_2 (x : u32) = 26 let mut r = 1 27 while r < x do 28 r *= 2 29 30 r 31