Skip to content

Commit

Permalink
Fix some unused variable verbose warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyevans committed Jan 22, 2023
1 parent 8193ddb commit 3c1e0ff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/rack/sendfile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def initialize(app, variation = nil, mappings = [])
end

def call(env)
status, headers, body = response = @app.call(env)
_, headers, body = response = @app.call(env)

if body.respond_to?(:to_path)
case type = variation(env)
Expand Down
2 changes: 1 addition & 1 deletion test/spec_lint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ def body.each; end
def body.to_path; __FILE__ end
app = lambda { |env| [200, {}, body] }

status, headers, body = Rack::Lint.new(app).call(env({}))
body = Rack::Lint.new(app).call(env({}))[2]
body.must_respond_to(:to_path)
body.to_path.must_equal __FILE__
end
Expand Down

3 comments on commit 3c1e0ff

@skipkayhil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @jeremyevans, would it be possible to backport this to 3-0-stable? These warnings have started to show up in the Rails test suite: https://buildkite.com/rails/rails/builds/97123#0188b6a0-d30f-4e6b-b74e-76bcf7a216cb/1069-1075

@jeremyevans
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not against a backport. Can you submit a pull request for the backport?

@skipkayhil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for such a quick response, I've opened a PR here: #2084

Please sign in to comment.