Extract branch rewrite function
Extract branch rewrite function

graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,rust-lang/rustfmt,aidancully/rust,aidancully/rust,graydon/rust,SingingTree/rustfmt,SingingTree/rustfmt,aidancully/rust,rust-lang/rustfmt,graydon/rust,graydon/rust,aidancully/rust