Skip to content

Commit

Permalink
Remove Enumerable include from Statement class (#1104)
Browse files Browse the repository at this point in the history
I'm honestly not sure why this was here in the first place. Git blame
seems to suggest that maybe it was added when the class was first
created in anticipation for something that never materialized or has
since been deprecated.

As far as I can tell, `Enumerable` offers no advantages to the class
since `Statement` doesn't implement `#each`.

Here's an example of what I'm referring to
```ruby
client = Mysql2::Client.new
statement = client.prepare('select 1')
statement.first
statement.any?
statement.min
```

Also all test pass with `Enumerable` gone, so it seems reasonable to
remove it.
  • Loading branch information
adamcrown authored Feb 5, 2020
1 parent f8560c5 commit 982dbdb
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions lib/mysql2/statement.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
module Mysql2
class Statement
include Enumerable

def execute(*args, **kwargs)
Thread.handle_interrupt(::Mysql2::Util::TIMEOUT_ERROR_CLASS => :never) do
_execute(*args, **kwargs)
Expand Down

0 comments on commit 982dbdb

Please sign in to comment.