2018-12-16 21:21:47 -06:00
|
|
|
struct Cat {
|
2015-01-08 05:02:42 -06:00
|
|
|
meows : usize,
|
2015-01-08 04:54:35 -06:00
|
|
|
how_hungry : isize,
|
2012-09-05 17:58:43 -05:00
|
|
|
}
|
|
|
|
|
2018-12-16 21:21:47 -06:00
|
|
|
fn cat(in_x : usize, in_y : isize) -> Cat {
|
|
|
|
Cat {
|
2012-09-05 17:58:43 -05:00
|
|
|
meows: in_x,
|
|
|
|
how_hungry: in_y
|
|
|
|
}
|
2012-03-28 00:08:48 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2018-12-16 21:21:47 -06:00
|
|
|
let nyan : Cat = cat(52, 99);
|
2019-04-22 02:40:08 -05:00
|
|
|
nyan.how_hungry = 0; //~ ERROR cannot assign
|
2012-03-28 00:08:48 -05:00
|
|
|
}
|