Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Commit

Permalink
fix: no dir error
Browse files Browse the repository at this point in the history
  • Loading branch information
zrll12 committed Jan 23, 2024
1 parent f1632a8 commit d2b36fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
/logs
/trash
/.idea
/config
config.toml
2 changes: 2 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ pub struct ServerConfig {

pub fn get_config() -> ServerConfig {
let mut raw_config = String::new();

std::fs::create_dir_all("config").unwrap();
let mut file = OpenOptions::new().read(true).write(true).create(true).open("config/config.toml").expect("Cannot open 'config.toml'");
file.read_to_string(&mut raw_config).unwrap();

Expand Down

0 comments on commit d2b36fa

Please sign in to comment.