Rector explicit indexing into a tuple unpacking

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2021-09-28 13:20:26 +02:00
parent bdaa087c17
commit a2b42c056c

View file

@ -255,10 +255,9 @@ def make_diff_metadata(crate, version, patch=False, store=False):
else:
cratef, crate, version = download(crate, version)
with files_from_crate(cratef, crate, version) as files:
diff = make_patch(files[0], enabled=patch)
metadata = Metadata.from_file(files[0])
doc_files, license_files = files[1:3]
with files_from_crate(cratef, crate, version) as (toml, doc_files, license_files):
diff = make_patch(toml, enabled=patch)
metadata = Metadata.from_file(toml)
if store:
shutil.copy2(cratef, os.path.join(os.getcwd(), f"{metadata.name}-{version}.crate"))
return crate, diff, metadata, doc_files, license_files