Add Bytes.to_int and Bytes.to_str #585

Merged
zxq9 merged 5 commits from bytes-to-x into master 2019-06-24 21:56:21 +09:00
2 changed files with 2 additions and 2 deletions
Showing only changes of commit 0ef7c59771 - Show all commits

View File

@ -1434,7 +1434,7 @@ create_bytes_constraints() ->
get_bytes_constraints() -> get_bytes_constraints() ->
ets_tab2list(bytes_constraints). ets_tab2list(bytes_constraints).
-spec add_bytes_constraint(byte_constraint()) -> ok. -spec add_bytes_constraint(byte_constraint()) -> true.
add_bytes_constraint(Constraint) -> add_bytes_constraint(Constraint) ->
ets_insert(bytes_constraints, Constraint). ets_insert(bytes_constraints, Constraint).

View File

@ -1324,7 +1324,7 @@ pp_call(Fun, Args) ->
pp_ftype(T) when is_atom(T) -> pp_text(T); pp_ftype(T) when is_atom(T) -> pp_text(T);
pp_ftype(any) -> pp_text("_"); pp_ftype(any) -> pp_text("_");
pp_ftype({tvar, X}) -> pp_text(X); pp_ftype({tvar, X}) -> pp_text(X);
pp_ftype({bytes, N}) -> pp_text(["bytes(", integer_to_list(N), ")"]); pp_ftype({bytes, N}) -> pp_text("bytes(" ++ integer_to_list(N) ++ ")");
pp_ftype({tuple, Ts}) -> pp_ftype({tuple, Ts}) ->
pp_parens(pp_par(pp_punctuate(pp_text(","), [pp_ftype(T) || T <- Ts]))); pp_parens(pp_par(pp_punctuate(pp_text(","), [pp_ftype(T) || T <- Ts])));
pp_ftype({list, T}) -> pp_ftype({list, T}) ->