Skip to content

Commit 49c4441

Browse files
committed
scripts: put src/solution.rs at the top
1 parent 5e622e2 commit 49c4441

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/srcpack.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Reads and assembles the source code in the crate at the path `crate_root`.
44
# `crate_root` usually equals `basm/`.
55
def read_assemble(crate_root, target_language):
6+
sol_first = []
67
sol_all = []
78
crate_src_path = os.path.join(crate_root, "src/")
89
for root, dirs, files in os.walk(crate_src_path):
@@ -13,7 +14,11 @@ def read_assemble(crate_root, target_language):
1314
if f_path.endswith(".rs"):
1415
with open(f_path, encoding='utf8') as f:
1516
sol = f.readlines()
16-
sol_all.append((f_path, sol))
17+
if os.path.abspath(f_path) == os.path.abspath(os.path.join(crate_root, "src/solution.rs")):
18+
sol_first.append((f_path, sol))
19+
else:
20+
sol_all.append((f_path, sol))
21+
sol_all = sol_first + sol_all
1722
if len(sol_all) == 1:
1823
sol_flat = sol_all[0][1]
1924
else:

0 commit comments

Comments
 (0)