Update docs' tests

Update the doc example code that uses owned strings to convert them
into StrBuf so that the code compiles.