change enum example

update source code to be compiled by latest rustc.