blob: f06dd2b0fcee6d11eddcec415959858b7f0c622e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
// Generated by hobgoblin.
/// A 2D shape.
#[derive(Debug, PartialEq)]
pub enum Shape {
Rectangle(crate::shapes::Rectangle),
Triangle(crate::shapes::Triangle),
}
impl ::std::convert::From<crate::shapes::Rectangle> for crate::shapes::Shape {
fn from(value: crate::shapes::Rectangle) -> Self {
Self::Rectangle(value)
}
}
impl ::std::convert::From<crate::shapes::Triangle> for crate::shapes::Shape {
fn from(value: crate::shapes::Triangle) -> Self {
Self::Triangle(value)
}
}
#[derive(Debug, PartialEq)]
pub struct Rectangle {
pub width: ::core::primitive::i32,
pub height: ::core::primitive::i32,
}
#[derive(Debug, PartialEq)]
pub struct Triangle {
pub width: ::core::primitive::i32,
pub height: ::core::primitive::i32,
}
|