diff options
author | Jeff King <peff@peff.net> | 2022-10-05 14:25:42 +0300 |
---|---|---|
committer | Jeff King <peff@peff.net> | 2022-10-05 16:28:15 +0300 |
commit | f9875971f9b0610bac8facc074f1293197026baf (patch) | |
tree | 1935b8d76b5ecafc825e1a4cea77cf2feb168931 | |
parent | f673838b4e5d49710792872c6a88c27eb985ade0 (diff) |
drop useless assignments of return values
In a block expected to return "bar", we might say:
foo = bar
as the last line. But since nobody looks at "foo", this is pointless.
Let's make clear that we don't care about the assignment here, but the
return value.
-rw-r--r-- | lib/tasks/index.rake | 6 | ||||
-rwxr-xr-x | script/doc_importer | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/tasks/index.rake b/lib/tasks/index.rake index 87ad7413..c5e90808 100644 --- a/lib/tasks/index.rake +++ b/lib/tasks/index.rake @@ -94,7 +94,7 @@ def index_l10n_doc(filter_tags, doc_list, get_content) html = asciidoc.render html.gsub!(/linkgit:(\S+)\[(\d+)\]/) do |line| x = /^linkgit:(\S+)\[(\d+)\]/.match(line) - line = "<a href='/docs/#{x[1]}/#{lang}'>#{x[1]}[#{x[2]}]</a>" + "<a href='/docs/#{x[1]}/#{lang}'>#{x[1]}[#{x[2]}]</a>" end # HTML anchor on hdlist1 (i.e. command options) html.gsub!(/<dt class="hdlist1">(.*?)<\/dt>/) do |_m| @@ -269,7 +269,7 @@ def index_doc(filter_tags, doc_list, get_content) html = asciidoc.render html.gsub!(/linkgit:(\S+)\[(\d+)\]/) do |line| x = /^linkgit:(\S+)\[(\d+)\]/.match(line) - line = "<a href='/docs/#{x[1]}'>#{x[1]}[#{x[2]}]</a>" + "<a href='/docs/#{x[1]}'>#{x[1]}[#{x[2]}]</a>" end # HTML anchor on hdlist1 (i.e. command options) html.gsub!(/<dt class="hdlist1">(.*?)<\/dt>/) do |_m| @@ -367,7 +367,7 @@ def local_index_doc(index_fun) get_file_list = lambda do |tree_sha| entries = `git ls-tree -r #{tree_sha}`.strip.split("\n") - tree = entries.map do |e| + entries.map do |e| _mode, _type, sha, path = e.split(" ") [path, sha] end diff --git a/script/doc_importer b/script/doc_importer index deb1e619..6abca5bf 100755 --- a/script/doc_importer +++ b/script/doc_importer @@ -12,7 +12,7 @@ doc = Asciidoctor::Document.new(content) html = doc.render html.gsub!(/linkgit:(.*)\[(\d+)\]/) do |line| x = /^linkgit:(.*)\[(\d+)\]/.match(line) - line = "<a href='/docs/#{x[1]}'>#{x[1]}[#{x[2]}]</a>" + "<a href='/docs/#{x[1]}'>#{x[1]}[#{x[2]}]</a>" end File.open("./git-diff.html", "w+") do |f| |