Skip to content

Commit e67d4c3

Browse files
authored
Refactor mktempdir function implementation
Refactor mktempdir to use explicit tuple match for clarity.
1 parent 512d10a commit e67d4c3

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/Radpath/tempfs.ex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ defmodule Radpath.Tempfs do
8585

8686
@spec mktempdir(bitstring) :: none
8787
def mktempdir(path \\ "/tmp") when is_bitstring(path) do
88-
Temp.mkdir(%{basedir: path}) |> tap({_, path_name} ~> path_name)
88+
## Temp.mkdir(%{basedir: path}) |> tap({_, path_name} ~> path_name)
89+
Temp.mkdir(%{basedir: path})
90+
|> tap(fn {:ok, path_name} -> path_name end) # Explicit tuple match
91+
8992
end
9093

9194
end

0 commit comments

Comments
 (0)