eval
Log in

A Default Method You Can Override

10 points

Summary::summarize has a default body. Implement it for Tweet so it overrides the default with "@username: content". Draft's impl is already given, empty — it deliberately falls through to the default, which your Tweet impl must not touch.

Required signature

pub trait Summary {     fn summarize(&self) -> String {         String::from("(no summary available)")     } }  pub struct Tweet {     pub username: String,     pub content: String, }  impl Summary for Tweet {     fn summarize(&self) -> String; }  pub struct Draft;  impl Summary for Draft {}

Visible tests

Your solution

Log in to submit a solution.