Skip to content

Commit

Permalink
Use match? instead of =~ when MatchData is not used
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed May 1, 2023
1 parent 37715de commit 52a873a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/t/cli.rb
Expand Up @@ -966,7 +966,7 @@ def extract_mentioned_screen_names(text)
([a-zA-Z0-9_]{1,20}) # $3: Screen name
/ox

return [] if text !~ at_signs
return [] if !text&.match?(at_signs)

text.to_s.scan(valid_mentions).collect do |_, _, screen_name|
screen_name
Expand Down
2 changes: 1 addition & 1 deletion lib/t/editor.rb
Expand Up @@ -26,7 +26,7 @@ def editor
end

def system_editor
RbConfig::CONFIG["host_os"] =~ /mswin|mingw/ ? "notepad" : "vi"
/mswin|mingw/.match?(RbConfig::CONFIG["host_os"]) ? "notepad" : "vi"
end
end
end
Expand Down

0 comments on commit 52a873a

Please sign in to comment.