Skip to content

Commit

Permalink
Use Macro.camelize/1 (#36)
Browse files Browse the repository at this point in the history
* Use Macro.camelize/1

* Remove upcase_first
  • Loading branch information
christopherlai authored Jun 10, 2024
1 parent 0302c64 commit ffeee2f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
4 changes: 1 addition & 3 deletions lib/grpc_reflection/service/builder/util.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ defmodule GrpcReflection.Service.Builder.Util do
end
end

def upcase_first(<<first::utf8, rest::binary>>), do: String.upcase(<<first::utf8>>) <> rest

def downcase_first(<<first::utf8, rest::binary>>),
do: String.downcase(<<first::utf8>>) <> rest

Expand Down Expand Up @@ -103,7 +101,7 @@ defmodule GrpcReflection.Service.Builder.Util do
name -> name
end)
|> String.split(".")
|> Enum.map(&upcase_first/1)
|> Enum.map(&Macro.camelize/1)
|> Module.safe_concat()
end

Expand Down
4 changes: 0 additions & 4 deletions test/builder/util_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ defmodule GrpcReflection.Service.Builder.UtilTest do
Util.get_package("testserviceV3.TestService")
end

test "upcase_first" do
assert "Hello" == Util.upcase_first("hello")
end

test "downcase_first" do
assert "hello" == Util.downcase_first("Hello")
end
Expand Down

0 comments on commit ffeee2f

Please sign in to comment.