There's a set of macros in ```common/util.rs``` that handle this sort of thing.