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
# this will allow us to remove `candidates.includes?(resource)`
candidates.each do |ref|
resource = ref.target
resource = ref.value
if resource && is_available?(resource)
@available.delete resource
resource.before_checkout
@ -63,7 +63,7 @@ module DB
end
resource = checkout
{resource, candidates.any? { |ref| ref.target == resource }}
{resource, candidates.any? { |ref| ref.value == resource }}
end
def release(resource : T) : Nil

View file

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