Skip to content

Commit 877dc7a

Browse files
committed
Add pub to fns
1 parent 4c0bb65 commit 877dc7a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

bin/generator-utils/generate_tests

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ use $(dash_to_underscore "$SLUG")::*;
2424
// Add tests here
2525
2626
EOT
27+
28+
# Flattens canonical json, extracts only the objects with a uuid
2729
cases=$(echo "$canonical_json" | jq '[ .. | objects | with_entries(select(.key | IN("uuid", "description", "input", "expected", "property"))) | select(. != {}) | select(has("uuid")) ]')
2830

2931
# shellcheck disable=SC2034
@@ -38,7 +40,7 @@ jq -c '.[]' <<<"$cases" | while read -r case; do
3840
# Push to file
3941

4042
echo "$formatted_template" >>"$TEST_FILE"
41-
printf "\\n" >> "$TEST_FILE"
43+
printf "\\n" >>"$TEST_FILE"
4244

4345
done
4446

bin/generator-utils/templates.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function create_lib_rs_template() {
7474
local exercise_dir=$1
7575
local slug=$2
7676
cat <<EOT >"${exercise_dir}/src/lib.rs"
77-
fn $(dash_to_underscore "$slug")() {
77+
pub fn $(dash_to_underscore "$slug")() {
7878
unimplemented!("implement ${slug} exercise")
7979
}
8080
EOT
@@ -101,7 +101,7 @@ function create_example_rs_template() {
101101
slug=$2
102102
mkdir "${exercise_dir}/.meta"
103103
cat <<EOT >"${exercise_dir}/.meta/example.rs"
104-
fn $(dash_to_underscore "$slug")() {
104+
pub fn $(dash_to_underscore "$slug")() {
105105
// TODO: Create a solution that passes all the tests
106106
unimplemented!("implement ${slug} exercise")
107107
}

0 commit comments

Comments
 (0)