Don't call .to_str() in examples/common

Calling .to_str() and passing the result to write!() is wasteful.