Skip to content

Commit 939b2e3

Browse files
lint,mypy: fix type checking issue
1 parent 1928752 commit 939b2e3

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/outpost/barbican/_internals/cargo_config.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@
1313

1414

1515
def run_cargo_config(rustargs: Path, target: Path, extra_args: str, outdir: Path) -> None:
16-
target = target.read_text().splitlines()[0]
17-
rustargs = rustargs.read_text().splitlines()
18-
rustargs.extend(extra_args.split(" "))
19-
linkerargs = list(filter(lambda x: x.startswith("-Clinker"), rustargs))
20-
linker = linkerargs[0].split("=")[1] if len(linkerargs) else "is not set"
21-
rustargs = list(filter(lambda x: not x.startswith("-Clinker"), rustargs))
16+
rust_target = target.read_text().splitlines()[0]
17+
rust_flags = rustargs.read_text().splitlines()
18+
rust_flags.extend(extra_args.split(" "))
19+
linker_args = list(filter(lambda x: x.startswith("-Clinker"), rust_flags))
20+
linker = linker_args[0].split("=")[1] if len(linker_args) else "is not set"
21+
rust_flags = list(filter(lambda x: not x.startswith("-Clinker"), rust_flags))
2222

2323
config = f"""
2424
[build]
25-
target = "{target}"
25+
target = "{rust_target}"
2626
target-dir = "{str(outdir.resolve())}"
27-
rustflags = {rustargs}
27+
rustflags = {rust_flags}
2828
29-
[target.{target}]
30-
{"#" if not len(linkerargs) else ""}linker = "{linker}"
29+
[target.{rust_target}]
30+
{"#" if not len(linker_args) else ""}linker = "{linker}"
3131
3232
[env]
3333
OUT_DIR = "{str(outdir.resolve())}"

0 commit comments

Comments
 (0)