Examples · learn/05-structs · 109 of 339
shorthand
tin run examples/learn/05-structs/shorthand.tintype Point = { x: int, y: int }
fn main() {
let x = 3
let y = 4
let p = Point { x, y } // same as Point { x: x, y: y }
print(p)
} Examples · learn/05-structs · 109 of 339
tin run examples/learn/05-structs/shorthand.tintype Point = { x: int, y: int }
fn main() {
let x = 3
let y = 4
let p = Point { x, y } // same as Point { x: x, y: y }
print(p)
}