update code for latest rust