The tempfile dependency causes build failure due to being in dev-dependencies. Adding cfg(test) fixes the isseue.