File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 3
3
# Reads and assembles the source code in the crate at the path `crate_root`.
4
4
# `crate_root` usually equals `basm/`.
5
5
def read_assemble (crate_root , target_language ):
6
+ sol_first = []
6
7
sol_all = []
7
8
crate_src_path = os .path .join (crate_root , "src/" )
8
9
for root , dirs , files in os .walk (crate_src_path ):
@@ -13,7 +14,11 @@ def read_assemble(crate_root, target_language):
13
14
if f_path .endswith (".rs" ):
14
15
with open (f_path , encoding = 'utf8' ) as f :
15
16
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
17
22
if len (sol_all ) == 1 :
18
23
sol_flat = sol_all [0 ][1 ]
19
24
else :
You can’t perform that action at this time.
0 commit comments