use newly available must_be(chars, ...) for better and shorter type test

This commit is contained in:
Markus Triska
2022-10-26 23:36:07 -06:00
committed by Mark Thom
parent 9c1de8e00b
commit 706ab2ae5b
+1 -2
View File
@@ -65,8 +65,7 @@
hex_bytes(Hs, Bytes) :-
( ground(Hs) ->
must_be(list, Hs),
maplist(must_be(atom), Hs),
must_be(chars, Hs),
( phrase(hex_bytes(Hs), Bytes) ->
true
; domain_error(hex_encoding, Hs, hex_bytes/2)