mirror of
https://github.com/notohh/rustlings.git
synced 2024-11-29 16:44:18 -05:00
Merge pull request #413 from danwilhelm/generics3-90chars
This commit is contained in:
commit
a180d831a1
1 changed files with 8 additions and 6 deletions
|
@ -1,10 +1,11 @@
|
||||||
// An imaginary magical school has a new report card generation system written in rust!
|
// An imaginary magical school has a new report card generation system written in Rust!
|
||||||
// Currently the system only supports creating report cards where the student's grade
|
// Currently the system only supports creating report cards where the student's grade
|
||||||
// is represented numerically (e.g. 1.0 -> 5.5). However, the school also issues alphabetical grades
|
// is represented numerically (e.g. 1.0 -> 5.5).
|
||||||
// (A+ -> F-) and needs to be able to print both types of report card!
|
// However, the school also issues alphabetical grades (A+ -> F-) and needs
|
||||||
|
// to be able to print both types of report card!
|
||||||
|
|
||||||
// Make the necessary code changes to support alphabetical report cards, thereby making the second
|
// Make the necessary code changes to support alphabetical report cards, thereby making
|
||||||
// test pass.
|
// the second test pass.
|
||||||
|
|
||||||
// I AM NOT DONE
|
// I AM NOT DONE
|
||||||
pub struct ReportCard {
|
pub struct ReportCard {
|
||||||
|
@ -15,7 +16,8 @@ pub struct ReportCard {
|
||||||
|
|
||||||
impl ReportCard {
|
impl ReportCard {
|
||||||
pub fn print(&self) -> String {
|
pub fn print(&self) -> String {
|
||||||
format!("{} ({}) - achieved a grade of {}", &self.student_name, &self.student_age, &self.grade)
|
format!("{} ({}) - achieved a grade of {}",
|
||||||
|
&self.student_name, &self.student_age, &self.grade)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue