We cant build recursive enum type, as the size of that time would be infitite

This commit is contained in:
Stephan Rehfeld 2026-05-27 17:50:24 +02:00
parent c4a794c4f2
commit 58a9c36d0d
3 changed files with 12 additions and 2 deletions

View File

@ -1,2 +1,2 @@
mod geometry; pub mod geometry;
pub mod math; pub mod math;

View File

@ -1,4 +1,10 @@
use hello::math::Point3; use hello::geometry::Geometry;
use hello::math::{Mat4x4, Point3};
enum SceneGraphNode {
Geometry(Mat4x4, Geometry),
SubNode(Mat4x4, SceneGraphNode),
}
fn main() { fn main() {
let p1 = Point3::new(0.0, 0.0, 0.0); let p1 = Point3::new(0.0, 0.0, 0.0);

View File

@ -90,6 +90,10 @@ impl Sub for Point3 {
} }
} }
pub struct Mat4x4 {
v: f64,
}
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;