From eb82b96c0d893ed7ff51c6eb7ce087688e6acc41 Mon Sep 17 00:00:00 2001 From: "Brian J. Cardiff" Date: Sat, 24 Dec 2016 20:39:40 -0300 Subject: [PATCH] update to crystal 0.20.3 * add missing forall annotations --- src/db/query_methods.cr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/db/query_methods.cr b/src/db/query_methods.cr index 802a6ad..a38d58b 100644 --- a/src/db/query_methods.cr +++ b/src/db/query_methods.cr @@ -64,7 +64,7 @@ module DB # ``` # name = db.query_one "select name from contacts where id = ?", 18, &.read(String) # ``` - def query_one(query, *args, &block : ResultSet -> U) : U + def query_one(query, *args, &block : ResultSet -> U) : U forall U query(query, *args) do |rs| raise DB::Error.new("no rows") unless rs.move_next @@ -114,7 +114,7 @@ module DB # name = db.query_one? "select name from contacts where id = ?", 18, &.read(String) # typeof(name) # => String | Nil # ``` - def query_one?(query, *args, &block : ResultSet -> U) : U? + def query_one?(query, *args, &block : ResultSet -> U) : U? forall U query(query, *args) do |rs| return nil unless rs.move_next @@ -164,7 +164,7 @@ module DB # ``` # names = db.query_all "select name from contacts", &.read(String) # ``` - def query_all(query, *args, &block : ResultSet -> U) : Array(U) + def query_all(query, *args, &block : ResultSet -> U) : Array(U) forall U ary = [] of U query(query, *args) do |rs| rs.each do