Looks good. You are right to use `view` here, since no one else keeps a reference to `buf` that they'll be mutating.