for x in type1 type2 type3 type4 type5 type6 ; do cat <<! impl Into<$x> for ProcessNode { fn into(self) -> $x { $x {some_boilerplate(self)} } } ! done
Poof! The above is replaced with the following:
impl Into<type1> for ProcessNode { fn into(self) -> type1 { type1 {some_boilerplate(self)} } } impl Into<type2> for ProcessNode { fn into(self) -> type2 { type2 {some_boilerplate(self)} } } impl Into<type3> for ProcessNode { fn into(self) -> type3 { type3 {some_boilerplate(self)} } } impl Into<type4> for ProcessNode { fn into(self) -> type4 { type4 {some_boilerplate(self)} } } impl Into<type5> for ProcessNode { fn into(self) -> type5 { type5 {some_boilerplate(self)} } } impl Into<type6> for ProcessNode { fn into(self) -> type6 { type6 {some_boilerplate(self)} } }