module main

@[heap]
struct Student {
	name string
	age  int
}

fn main() {
	mut students := []Student{}
	students << Student{
		name: 'Mike'
		age:  16
	}
	students << Student{
		name: 'Amy'
		age:  15
	}

	_ := get_amy(students) or { unsafe { nil } }
}

fn get_amy(students []Student) ?&Student {
	for s in students {
		if s.name == 'Amy' {
			return &s
		}
	}
	return none
}
