elixir-toniq / circular_buffer

18 stars 2 forks source link

Use Elixir's default slice implementation #2

Closed fhunleth closed 4 years ago

fhunleth commented 4 years ago

Enumerable.List.slice changed in Elixir 1.10, so this fixes:

warning: Enumerable.List.slice/3 is undefined or private. Did you mean one of:

      * slice/1
      * slice/4

  lib/circular_buffer.ex:90: Enumerable.CircularBuffer.slice/1

Elixir's default slice implementation calls reduce and this change works in Elixir 1.8 - 1.10. I didn't test earlier versions.

This commit also adds a test to verify that Enum.slice works at least as well as the Elixir's implementation for lists.

keathley commented 4 years ago

LGTM :tada: