Skip to content

Invidious is an alternative front-end to YouTube

Fix Ameba Lint/UselessAssign

syeopite89a0761a19f4
diff --git a/spec/http_server/handlers/static_assets_handler_spec.cr b/spec/http_server/handlers/static_assets_handler_spec.cr
index 9b7a363e..373d59fd 100644
--- a/spec/http_server/handlers/static_assets_handler_spec.cr
+++ b/spec/http_server/handlers/static_assets_handler_spec.cr
@@ -106,8 +106,7 @@ Spectator.describe StaticAssetsHandler do
file_link = "/#{File.basename(temporary_file.path)}"
# Make request
- headers = HTTP::Headers{"Range" => "bytes=0-2"}
- response = handle HTTP::Request.new("GET", file_link, headers)
+ handle HTTP::Request.new("GET", file_link, HTTP::Headers{"Range" => "bytes=0-2"})
# Mutate file on disk
temporary_file << "Something else"
diff --git a/src/invidious/http_server/static_assets_handler.cr b/src/invidious/http_server/static_assets_handler.cr
index 8f2c1b7e..94add5a8 100644
--- a/src/invidious/http_server/static_assets_handler.cr
+++ b/src/invidious/http_server/static_assets_handler.cr
@@ -71,7 +71,7 @@ module Invidious::HttpServer
# Writes file data to the cache
private def flush_io_to_cache(io, file_path, file_info)
- if @@cached_files.sum(&.[1].size) + (size = file_info.size) < CACHE_LIMIT
+ if @@cached_files.sum(&.[1].size) + file_info.size < CACHE_LIMIT
data_slice = io.to_slice
@@cached_files[file_path] = CachedFile.new(data_slice, file_info.size, file_info.modification_time)
end