From 519c227c4f4df81522e38b34e6a5ddfdb73f0def Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Sat, 29 Jan 2022 13:43:26 +0100 Subject: [PATCH] Use short syntax for 'File.open' block --- src/invidious/helpers/static_file_handler.cr | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/invidious/helpers/static_file_handler.cr b/src/invidious/helpers/static_file_handler.cr index 6b3cd22e..6ef2d74c 100644 --- a/src/invidious/helpers/static_file_handler.cr +++ b/src/invidious/helpers/static_file_handler.cr @@ -175,8 +175,7 @@ module Kemal if @cached_files.sum(&.[1][:data].bytesize) + (size = File.size(file_path)) < CACHE_LIMIT data = Bytes.new(size) - - File.open(file_path) { |f| f.read(data) } + File.open(file_path, &.read(data)) filestat = File.info(file_path)