Skip to content

Instantly share code, notes, and snippets.

@Jammyjamjamman
Created July 28, 2019 01:07
Show Gist options
  • Save Jammyjamjamman/3c09f03aeee70bae6ad95bca5f9e12c9 to your computer and use it in GitHub Desktop.
Save Jammyjamjamman/3c09f03aeee70bae6ad95bca5f9e12c9 to your computer and use it in GitHub Desktop.
infer type
struct Item {
name: String,
weight: String,
mass: u64,
}
fn main() {
println!("Hello, world!");
// should the weight be displayed using the metric system?
// Should the weight be using a value that can be used to auto-determine its mass?
let data = [
Item {
name: String::from("Chocolate chip cookie"),
weight: String::from("2 ounces"),
mass: 0,
},
Item {
name: String::from("Uranium"),
weight: String::from("1 ounces"),
mass: 0,
},
Item {
name: String::from("Newborn baby"),
weight: String::from("8 pounds, 6 ounces"),
mass: 0,
},
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment