cargo cult: use methods library to avoid error message about 'as'