-
Notifications
You must be signed in to change notification settings - Fork 164
Remove compile warnings #274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove compile warnings #274
Conversation
|
|
||
| defp remove_stale_brokers(brokers, metadata_brokers) do | ||
| {brokers_to_keep, brokers_to_remove} = Enum.partition(brokers, fn(broker) -> | ||
| {brokers_to_keep, brokers_to_remove} = apply(Enum, :partition, [brokers, fn(broker) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long (max is 80, was 94).
| case Regex.scan(~r/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/, host) do | ||
| [match_data] = [[_, _, _, _, _]] -> match_data |> tl |> List.flatten |> Enum.map(&String.to_integer/1) |> List.to_tuple | ||
| _ -> to_char_list(host) | ||
| _ -> apply(String, :to_char_list, [host]) # to_char_list is deprecated from Elixir 1.3 onward |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long (max is 80, was 99).
|
Ebert has finished reviewing this Pull Request and has found:
You can see more details about this review at https://ebertapp.io/github/kafkaex/kafka_ex/pulls/274. |
bjhaid
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, we need to come up with some policy for deprecating older versions of Elixir
| def terminate(_, state) do | ||
| Logger.log(:debug, "Shutting down worker #{inspect state.worker_name}") | ||
| if state.event_pid do | ||
| GenEvent.stop(state.event_pid) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably dead code, there should be no use of GenEvent in Kafkaex AFAIK
joshuawscott
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
Thanks again @thecodeboss |
Remove compile warnings
When compiling kafka_ex, there are a bunch of annoying compile warnings that get spit out on later Elixir versions like 1.5 and 1.6.
Firstly,
char_listhas been deprecated in favour ofcharlistin many places. For typespecs, we can support both by using[char]instead. ForString.to_char_list, we can useapply(String, :to_char_list, [arg])to stop the warning, and the method exists in all Elixir versions.Second,
Enum.partitionis deprecated, so I tweaked to remove the warning.I also removed some unused arguments, a missing protocol implementation for
Enumerable.slice/1, and a typo.