get rid of some duplicate code
get rid of some duplicate code

chris-morgan/rust-playpen,Enamex/rust-playpen,rust-lang/rust-playpen,drlagos/unify-playpen,chris-morgan/rust-playpen,chris-morgan/rust-playpen,cogumbreiro/scribble-playpen,drlagos/mpisessions-playpen,epdtry/cse333-rust-slides,Enamex/rust-playpen,epdtry/cse333-rust-slides,epdtry/cse333-rust-slides,lastorset/rust-playpen,cogumbreiro/sepi-playpen,plietar/pony-playpen,tilpner/rust-playpen,tilpner/rust-playpen,Limvot/kraken-playpen,drlagos/unify-playpen,chris-morgan/rust-playpen,cogumbreiro/scribble-playpen,plietar/pony-playpen,cogumbreiro/scribble-playpen,Limvot/kraken-playpen,epdtry/cse333-rust-slides,plietar/pony-playpen,lastorset/rust-playpen,Enamex/rust-playpen,Enamex/rust-playpen,rust-lang/rust-playpen,drlagos/mpisessions-playpen,lastorset/rust-playpen,plietar/pony-playpen,tilpner/rust-playpen,tilpner/rust-playpen,Limvot/kraken-playpen,lastorset/rust-playpen,rust-lang/rust-playpen,rust-lang/rust-playpen,cogumbreiro/sepi-playpen