mirror of https://github.com/sunface/rust-course
				
				
				
			
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					16 lines
				
				387 B
			
		
		
			
		
	
	
					16 lines
				
				387 B
			| 
								 
											4 years ago
										 
									 | 
							
								// strings1.rs
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								// 在不改变函数签名的要求下通过编译!
							 | 
						||
| 
								 | 
							
								// 执行 `rustlings hint strings1` 获取提示 ;)
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 | 
							
								// I AM NOT DONE
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								fn main() {
							 | 
						||
| 
								 | 
							
								    let answer = current_favorite_color();
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								    println!("My current favorite color is {}", answer);// 译:"当前我最喜爱的颜色是 {}"
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								// 译:当前最喜爱的颜色
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								fn current_favorite_color() -> String {
							 | 
						||
| 
								 | 
							
								    "blue"
							 | 
						||
| 
								 | 
							
								}
							 |