Step Into Labs

Step Into Rust · Module exam · Ownership & Types

Exam: The Shape Gallery

Parse shapes into an enum, measure them through a trait and borrow the biggest one.

Part of Step Into Rust. The full module exam, its missions and the real compiler and debugger are in the course. Try a free lesson first to see how it works.

A drawing app sends you its shapes as lines of text. Turn them into a proper Rust type, measure every one through a trait, and find the largest without copying anything. Lines that do not describe a valid shape are reported and skipped, never a reason to crash.

In this module exam

Missions

  1. Measure the gallery