Stebalien / tempfile

Temporary file library for rust
http://stebalien.com/projects/tempfile-rs
Apache License 2.0
1.2k stars 120 forks source link

feature: `with_suffix` to correspond to `with_prefix` #298

Closed Borgerr closed 2 months ago

Borgerr commented 2 months ago

Stumbled upon while trying to wrangle some integration testing for a CLI tool, which expects a specific filetype. with_prefix adds a short string to the start of a file's name. We can alter this very cleanly by simply doing some plumbing for adding a short string to the end of the file's name, instead. Builder already has a suffix method which we can leverage for this.

Stebalien commented 2 months ago

Seems reasonable, I'm happy to review a patch.