We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 773cac0 commit 124ee5bCopy full SHA for 124ee5b
exercises/quiz3.rs
@@ -18,13 +18,13 @@
18
19
// I AM NOT DONE
20
21
-pub struct ReportCard {
22
- pub grade: f32,
+pub struct ReportCard<T> {
+ pub grade: T,
23
pub student_name: String,
24
pub student_age: u8,
25
}
26
27
-impl ReportCard {
+impl<T: std::fmt::Display> ReportCard<T> {
28
pub fn print(&self) -> String {
29
format!("{} ({}) - achieved a grade of {}",
30
&self.student_name, &self.student_age, &self.grade)
@@ -52,7 +52,7 @@ mod tests {
52
fn generate_alphabetic_report_card() {
53
// TODO: Make sure to change the grade here after you finish the exercise.
54
let report_card = ReportCard {
55
- grade: 2.1,
+ grade: "A+",
56
student_name: "Gary Plotter".to_string(),
57
student_age: 11,
58
};
0 commit comments