Use enums

This commit is contained in:
Stephan Rehfeld 2026-04-29 18:40:36 +02:00
parent 5daaf9e1bc
commit 45cad795a7

View File

@ -1,4 +1,5 @@
use std::ops::{Add, Div, Mul, Sub};
use std::collections::
#[derive(Copy, Clone)]
struct Vector3 {
@ -120,6 +121,7 @@ impl Sphere {
enum Geometry {
Sphere(Sphere),
Plane(Plane),
Line(Line),
}
fn main() {
@ -140,6 +142,7 @@ fn main() {
match geo {
Geometry::Sphere(s) => println!("A Sphere"),
Geometry::Plane(p) => println!("A Plane"),
Geometry::Line(l) => println!("A Line"),
}
}
}