From 49ace6fca7a2a61d31dcb7ba0ae2bde6f6e6893b Mon Sep 17 00:00:00 2001 From: syeopite Date: Tue, 28 Sep 2021 15:05:46 -0700 Subject: [PATCH] Reduce complexity of Crystal 1.0.0 workaround --- src/invidious/helpers/utils.cr | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/invidious/helpers/utils.cr b/src/invidious/helpers/utils.cr index 486aea97..4254dd8e 100644 --- a/src/invidious/helpers/utils.cr +++ b/src/invidious/helpers/utils.cr @@ -1,11 +1,8 @@ require "lsquic" require "db" -{% unless Crystal::VERSION == "1.0.0" %} - # Alias of DB::Pool for easier debugging - class YTPool(T) < DB::Pool(T) - end -{% end %} +# Alias of DB::Pool for easier debugging +alias YTPool = DB::Pool def add_yt_headers(request) request.headers["user-agent"] ||= "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36" @@ -26,12 +23,7 @@ struct YoutubeConnectionPool property! url : URI property! capacity : Int32 property! timeout : Float64 - - {% unless Crystal::VERSION == "1.0.0" %} - property pool : YTPool(QUIC::Client | HTTP::Client) - {% else %} - property pool : DB::Pool(QUIC::Client | HTTP::Client) - {% end %} + property pool : YTPool(QUIC::Client | HTTP::Client) def initialize(url : URI, @initial_pool_size = 1,