Skip to content

Commit f1ad68d

Browse files
Compatibility with Elixir v1.16 (#30)
* use Enum.slice(first..last//1) * bump version * fix failed unit tests on grpc v0.8.1
1 parent fde0c52 commit f1ad68d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/grpc_reflection/service/builder/util.ex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ defmodule GrpcReflection.Service.Builder.Util do
88
@type_message Map.fetch!(Google.Protobuf.FieldDescriptorProto.Type.mapping(), :TYPE_MESSAGE)
99

1010
def get_package(symbol) do
11-
parent_symbol = symbol |> String.split(".") |> Enum.slice(0..-2) |> Enum.join(".")
11+
parent_symbol = symbol |> String.split(".") |> Enum.slice(0..-2//1) |> Enum.join(".")
1212

1313
try do
1414
parent_module = convert_symbol_to_module(parent_symbol)
@@ -125,12 +125,15 @@ defmodule GrpcReflection.Service.Builder.Util do
125125
module.__rpc_calls__()
126126
|> Enum.find(fn
127127
{_, _, _} -> true
128+
{_, _, _, _} -> true
128129
_ -> false
129130
end)
130131
|> then(fn
131132
nil -> "proto2"
132133
{_, {req, _}, _} -> get_syntax(req)
134+
{_, {req, _}, _, _} -> get_syntax(req)
133135
{_, _, {req, _}} -> get_syntax(req)
136+
{_, _, {req, _}, _} -> get_syntax(req)
134137
end)
135138

136139
true ->

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule GrpcReflection.MixProject do
22
use Mix.Project
33

4-
@version "0.1.1"
4+
@version "0.1.2"
55
@source_url "https://github.com/elixir-grpc/grpc-reflection"
66
@description "gRPC reflection server for Elixir"
77

0 commit comments

Comments
 (0)