Skip to content

Commit b4eaafc

Browse files
committed
refactor: Remove accepted, rejected subdirectory in solution
1 parent 29f1de7 commit b4eaafc

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/file_manager/git.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,7 @@ impl GitManager {
121121

122122
async fn create_default_directories(&self) -> Result<()> {
123123
let base_path = PathBuf::from(UPLOAD_DIR).join(self.problem_id.to_string());
124-
let directories = [
125-
"solutions/accepted",
126-
"solutions/rejected",
127-
"tests",
128-
"statements",
129-
];
124+
let directories = ["solutions", "tests", "statements"];
130125
for dir in directories {
131126
let path = base_path.join(dir);
132127
fs::create_dir_all(path)
@@ -236,6 +231,9 @@ mod tests {
236231
let problem_id = 12;
237232
let git_manager = GitManager::new(problem_id);
238233
assert!(git_manager.create_default_directories().await.is_ok());
234+
assert!(Path::new(format!("{UPLOAD_DIR}/{problem_id}/solutions").as_str()).exists());
235+
assert!(Path::new(format!("{UPLOAD_DIR}/{problem_id}/tests").as_str()).exists());
236+
assert!(Path::new(format!("{UPLOAD_DIR}/{problem_id}/statements").as_str()).exists());
239237

240238
fs::remove_dir_all(format!("{UPLOAD_DIR}/{problem_id}")).await?;
241239
Ok(())

0 commit comments

Comments
 (0)