finish until lifetimes
This commit is contained in:
@@ -12,18 +12,18 @@
|
||||
// block to support alphabetical report cards in addition to numerical ones.
|
||||
|
||||
// TODO: Adjust the struct as described above.
|
||||
struct ReportCard {
|
||||
grade: f32,
|
||||
struct ReportCard<T> {
|
||||
grade: T,
|
||||
student_name: String,
|
||||
student_age: u8,
|
||||
}
|
||||
|
||||
// TODO: Adjust the impl block as described above.
|
||||
impl ReportCard {
|
||||
impl<T: std::fmt::Display> ReportCard<T> {
|
||||
fn print(&self) -> String {
|
||||
format!(
|
||||
"{} ({}) - achieved a grade of {}",
|
||||
&self.student_name, &self.student_age, &self.grade,
|
||||
&self.student_name, &self.student_age, &self.grade
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user