Updated code to work with latest rust master