Skip to content

Commit 3c16148

Browse files
committed
add function specs
1 parent 1306b54 commit 3c16148

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/scenic/cache/hash.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ defmodule Scenic.Cache.Hash do
176176
If the verification passes, returns `{:ok, hash}`
177177
If it fails, returns `{:error, :hash_failure}`
178178
"""
179+
@spec verify_file(path :: bitstring, hash :: bitstring, type :: hash_type) :: binary | hash_error
179180
def verify_file(path, hash, hash_type) do
180181
case file(path, hash_type) do
181182
{:ok, computed_hash} ->
@@ -196,6 +197,7 @@ defmodule Scenic.Cache.Hash do
196197
If the verification passes, returns the hash unchanged.
197198
If it fails, raises an error
198199
"""
200+
@spec verify_file!(path :: bitstring, hash :: bitstring, type :: hash_type) :: binary | no_return
199201
def verify_file!(path, hash, hash_type) do
200202
case file!(path, hash_type) == hash do
201203
true -> hash

0 commit comments

Comments
 (0)