You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.with_context(|| format!("Failed to read the file {path}"))?;
97
105
98
106
if !file_buf.contains("fn main()"){
99
-
bail!("The `main` function is missing in the file `{path}`.\nCreate at least an empty `main` function to avoid language server errors");
107
+
bail!(
108
+
"The `main` function is missing in the file `{path}`.\nCreate at least an empty `main` function to avoid language server errors"
109
+
);
100
110
}
101
111
102
112
if !file_buf.contains("// TODO"){
103
-
bail!("Didn't find any `// TODO` comment in the file `{path}`.\nYou need to have at least one such comment to guide the user.");
113
+
bail!(
114
+
"Didn't find any `// TODO` comment in the file `{path}`.\nYou need to have at least one such comment to guide the user."
115
+
);
104
116
}
105
117
106
118
let contains_tests = file_buf.contains("#[test]\n");
107
119
if exercise_info.test{
108
120
if !contains_tests {
109
-
bail!("The file `{path}` doesn't contain any tests. If you don't want to add tests to this exercise, set `test = false` for this exercise in the `info.toml` file");
121
+
bail!(
122
+
"The file `{path}` doesn't contain any tests. If you don't want to add tests to this exercise, set `test = false` for this exercise in the `info.toml` file"
123
+
);
110
124
}
111
125
}elseif contains_tests {
112
-
bail!("The file `{path}` contains tests annotated with `#[test]` but the exercise `{name}` has `test = false` in the `info.toml` file");
126
+
bail!(
127
+
"The file `{path}` contains tests annotated with `#[test]` but the exercise `{name}` has `test = false` in the `info.toml` file"
anyhow!("Found the file `{}`. Only `README.md` and Rust files related to an exercise in `info.toml` are allowed in the `{dir}` directory", path.display())
144
+
anyhow!(
145
+
"Found the file `{}`. Only `README.md` and Rust files related to an exercise in `info.toml` are allowed in the `{dir}` directory",
146
+
path.display()
147
+
)
129
148
};
130
149
131
150
for entry inread_dir(dir).with_context(|| format!("Failed to open the `{dir}` directory"))? {
0 commit comments