| 
						
						
						
					 | 
					 | 
					@ -1,14 +1,11 @@
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// An imaginary magical school has a new report card generation system written in Rust!
 | 
					 | 
					 | 
					 | 
					// 一所想象的魔法学院有一个采用 Rust 编写的新版成绩单生成系统!
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// Currently the system only supports creating report cards where the student's grade
 | 
					 | 
					 | 
					 | 
					// 目前该系统仅支持创建以数字表示的成绩单(如 1.0 -> 5.5)。
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// is represented numerically (e.g. 1.0 -> 5.5).
 | 
					 | 
					 | 
					 | 
					// 然而,学校也发布用字母表示的成绩(A+ -> F-),所以需要能够打印两种成绩单。
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// 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 in the struct ReportCard and the impl block
 | 
					 | 
					 | 
					 | 
					// 在 ReportCard 结构定义和 impl 块中进行必要的代码修改,以支持用字母表示的成绩单。
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// to support alphabetical report cards. Change the Grade in the second test to "A+"
 | 
					 | 
					 | 
					 | 
					// 将第二个测试的 grade 改为 "A+",用来表明代码已允许按字母表示成绩。
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// to show that your changes allow alphabetical grades.
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// Execute 'rustlings hint generics3' for hints!
 | 
					 | 
					 | 
					 | 
					// 执行 'rustlings hint generics3' 获取提示!
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// I AM NOT DONE
 | 
					 | 
					 | 
					 | 
					// I AM NOT DONE
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -20,7 +17,7 @@ pub struct ReportCard {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					impl ReportCard {
 | 
					 | 
					 | 
					 | 
					impl ReportCard {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    pub fn print(&self) -> String {
 | 
					 | 
					 | 
					 | 
					    pub fn print(&self) -> String {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        format!("{} ({}) - achieved a grade of {}",
 | 
					 | 
					 | 
					 | 
					        format!("{} ({}) - achieved a grade of {}",// 译:{} ({}) - 成绩为 {}"
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            &self.student_name, &self.student_age, &self.grade)
 | 
					 | 
					 | 
					 | 
					            &self.student_name, &self.student_age, &self.grade)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -44,7 +41,7 @@ mod tests {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    #[test]
 | 
					 | 
					 | 
					 | 
					    #[test]
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    fn generate_alphabetic_report_card() {
 | 
					 | 
					 | 
					 | 
					    fn generate_alphabetic_report_card() {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        // TODO: Make sure to change the grade here after you finish the exercise.
 | 
					 | 
					 | 
					 | 
					        // TODO:完成练习后,在这里更改 grade 的值。
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        let report_card = ReportCard {
 | 
					 | 
					 | 
					 | 
					        let report_card = ReportCard {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            grade: 2.1,
 | 
					 | 
					 | 
					 | 
					            grade: 2.1,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            student_name: "Gary Plotter".to_string(),
 | 
					 | 
					 | 
					 | 
					            student_name: "Gary Plotter".to_string(),
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
 
 |