Fix sample program to compile in modern rust
auto merge of #4827 : mcpherrinm/rust/master, r=pcwalton

It seems to me the library needs more work to be done, but having a non-compilable sample program seems like bad news.