Compare commits
2 commits
0e96a25e46
...
f09a02a58d
| Author | SHA1 | Date | |
|---|---|---|---|
| f09a02a58d | |||
| 0600c382fe |
2 changed files with 11 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "bingus"
|
name = "bingus"
|
||||||
version = "0.6.0"
|
version = "0.8.0"
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
description.workspace = true
|
description.workspace = true
|
||||||
|
|
|
||||||
|
|
@ -29,12 +29,22 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(PartialEq, Eq)]
|
||||||
#[cfg_attr(debug_assertions, derive(Debug))]
|
#[cfg_attr(debug_assertions, derive(Debug))]
|
||||||
pub struct Dimensions {
|
pub struct Dimensions {
|
||||||
pub width: u32,
|
pub width: u32,
|
||||||
pub height: u32,
|
pub height: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Dimensions {
|
||||||
|
pub fn square(width: u32) -> Self {
|
||||||
|
Self {
|
||||||
|
width,
|
||||||
|
height: width,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Div<Dimensions> for Dimensions {
|
impl Div<Dimensions> for Dimensions {
|
||||||
type Output = Dimensions;
|
type Output = Dimensions;
|
||||||
fn div(self, rhs: Dimensions) -> Self::Output {
|
fn div(self, rhs: Dimensions) -> Self::Output {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue