eval
Log in

Implement a Trait for One Type

10 points

Implement Greet for Robot, so greet returns the robot's name, upper-cased, wrapped in a fixed announcement of format `BEEP BOOP, I AM <name>`. This is the smallest possible trait: one method, one implementor, no default body.

Required signature

pub trait Greet {     fn greet(&self) -> String; }  pub struct Robot {     pub name: String, }  impl Greet for Robot {     fn greet(&self) -> String; }

Visible tests

Your solution

Log in to submit a solution.