From 098e8c2873ed7cfa276aa87967ce28ac711cbb30 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Thu, 23 Jul 2020 23:44:25 +0900 Subject: [PATCH] Suppress "assigned but unused variable" warnings --- lib/irb/ruby-lex.rb | 2 +- test/fiber/test_io.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb index 6a7df1ad96..5d7bf006be 100644 --- a/lib/irb/ruby-lex.rb +++ b/lib/irb/ruby-lex.rb @@ -34,7 +34,7 @@ class RubyLex line_no = 1 begin result = yield code, line_no - rescue ArgumentError => e + rescue ArgumentError code = ";\n#{code}" line_no = 0 result = yield code, line_no diff --git a/test/fiber/test_io.rb b/test/fiber/test_io.rb index 270e4f35e7..c23f67edaa 100644 --- a/test/fiber/test_io.rb +++ b/test/fiber/test_io.rb @@ -44,14 +44,14 @@ class TestFiberIO < Test::Unit::TestCase skip unless defined?(UNIXSocket) 16.times.map do - thread = Thread.new do + Thread.new do i, o = UNIXSocket.pair scheduler = Scheduler.new Thread.current.scheduler = scheduler Fiber do - message = i.read(20) + i.read(20) i.close end