#Rust question!

Is this a good way to write a function that can write either to Terminal (println!) or a file?

gist.github.com/sts10/555205fc

@mbrubeck ah! I think I was reaching for something like this early on, but couldn't figure out how to make it work.
Thanks!

Sign in to participate in the conversation
Mastodon

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!