Update to crystal 0.22.0 (#50)

* `WeakRef#target` was renamed to `WeakRef#value`
This commit is contained in:
Nick Franken 2017-04-21 09:14:42 -05:00 committed by Brian J. Cardiff
parent 912113d7fb
commit 5d5b901da1
2 changed files with 3 additions and 3 deletions

View File

@ -54,7 +54,7 @@ module DB
# TODO honor candidates while waiting for availables # TODO honor candidates while waiting for availables
# this will allow us to remove `candidates.includes?(resource)` # this will allow us to remove `candidates.includes?(resource)`
candidates.each do |ref| candidates.each do |ref|
resource = ref.target resource = ref.value
if resource && is_available?(resource) if resource && is_available?(resource)
@available.delete resource @available.delete resource
resource.before_checkout resource.before_checkout
@ -63,7 +63,7 @@ module DB
end end
resource = checkout resource = checkout
{resource, candidates.any? { |ref| ref.target == resource }} {resource, candidates.any? { |ref| ref.value == resource }}
end end
def release(resource : T) : Nil def release(resource : T) : Nil

View File

@ -40,7 +40,7 @@ module DB
private def clean_connections private def clean_connections
# remove disposed or closed connections # remove disposed or closed connections
@connections.each do |ref| @connections.each do |ref|
conn = ref.target conn = ref.value
if !conn || conn.closed? if !conn || conn.closed?
@connections.delete ref @connections.delete ref
end end