File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 11package os
22
33import java .nio .file .attribute .{FileAttribute , PosixFilePermissions }
4- import scala .util .{ Using , Try }
4+ import scala .util .Using
55
66/**
77 * Create temporary files and directories. [[withTempFile ]] and [[withTempDir ]]
@@ -92,8 +92,8 @@ object temp {
9292 * }
9393 * }}}
9494 */
95- def withTempFile [A ](fun : Path => A ): Try [ A ] =
96- Using (os.temp(
95+ def withTempFile [A ](fun : Path => A ): A =
96+ Using .resource (os.temp(
9797 deleteOnExit = false // TempFile.close() deletes it, no need to register with JVM
9898 ))(fun)
9999
@@ -108,8 +108,8 @@ object temp {
108108 * }
109109 * }}}
110110 */
111- def withTempDir [A ](fun : Path => A ): Try [ A ] =
112- Using (os.temp.dir(
111+ def withTempDir [A ](fun : Path => A ): A =
112+ Using .resource (os.temp.dir(
113113 deleteOnExit = false // TempFile.close() deletes it, no need to register with JVM
114114 ))(fun)
115115
You can’t perform that action at this time.
0 commit comments