Inlined code for operating on scala -> operating on vec

I don't know the rules regarding traits and inlining.