feat(wpcarro/rust): Include std::fmt::Display example
Gotta know how to `to_string` things Change-Id: I259ef61ecaf6ae7fabe0b3d211706ba5f429b3a7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6057 Reviewed-by: wpcarro <wpcarro@gmail.com> Autosubmit: wpcarro <wpcarro@gmail.com> Tested-by: BuildkiteCI
This commit is contained in:
		
							parent
							
								
									783e1190cd
								
							
						
					
					
						commit
						4732603a42
					
				
					 6 changed files with 123 additions and 50 deletions
				
			
		
							
								
								
									
										18
									
								
								users/wpcarro/scratch/rust/src/main.rs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								users/wpcarro/scratch/rust/src/main.rs
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,18 @@ | |||
| use serde::{Deserialize, Serialize}; | ||||
| use serde_json::{json, Value}; | ||||
| 
 | ||||
| mod display; | ||||
| mod json; | ||||
| 
 | ||||
| ////////////////////////////////////////////////////////////////////////////////
 | ||||
| // Main
 | ||||
| ////////////////////////////////////////////////////////////////////////////////
 | ||||
| 
 | ||||
| fn main() { | ||||
|     let john: display::Person = display::Person { | ||||
|         fname: "John".to_string(), | ||||
|         lname: "Cleese".to_string(), | ||||
|         age: 82, | ||||
|     }; | ||||
|     println!("Person: {}", john) | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue