From 066af00eebe662e5a589a4e274e1613201b36982 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Thu, 2 Jul 2026 09:57:35 +0100 Subject: Support translating sums into Rust types --- examples/02-sum/output/rust/src/shapes.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 examples/02-sum/output/rust/src/shapes.rs (limited to 'examples/02-sum/output/rust/src/shapes.rs') diff --git a/examples/02-sum/output/rust/src/shapes.rs b/examples/02-sum/output/rust/src/shapes.rs new file mode 100644 index 0000000..9bb32f4 --- /dev/null +++ b/examples/02-sum/output/rust/src/shapes.rs @@ -0,0 +1,15 @@ +/// A 2D shape. +pub enum Shape { + Rectangle(crate::shapes::Rectangle), + Triangle(crate::shapes::Triangle), +} + +pub struct Rectangle { + pub width: i32, + pub height: i32, +} + +pub struct Triangle { + pub width: i32, + pub height: i32, +} -- cgit v1.2.3