diff options
| author | mo8it <mo8it@proton.me> | 2024-04-14 02:41:19 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-04-14 02:41:19 +0200 |
| commit | bee62c89de09fdd9823cba81e07f0f8528fe8ef9 (patch) | |
| tree | bca32899b02862936905ed84624ebd3af2b0e691 /src/app_state/state_file.rs | |
| parent | 5c0073a9485c4226e58b657cb49628919a28a942 (diff) | |
Add terminal links
Diffstat (limited to 'src/app_state/state_file.rs')
| -rw-r--r-- | src/app_state/state_file.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/app_state/state_file.rs b/src/app_state/state_file.rs index 364a1fa..4e4a0e1 100644 --- a/src/app_state/state_file.rs +++ b/src/app_state/state_file.rs @@ -59,7 +59,7 @@ pub fn write(app_state: &AppState) -> Result<()> { exercises: ExercisesStateSerializer(&app_state.exercises), }; - let mut buf = Vec::with_capacity(1024); + let mut buf = Vec::with_capacity(4096); serde_json::ser::to_writer(&mut buf, &content).context("Failed to serialize the state")?; fs::write(STATE_FILE_NAME, buf) .with_context(|| format!("Failed to write the state file `{STATE_FILE_NAME}`"))?; @@ -69,8 +69,6 @@ pub fn write(app_state: &AppState) -> Result<()> { #[cfg(test)] mod tests { - use std::path::Path; - use crate::info_file::Mode; use super::*; @@ -81,14 +79,14 @@ mod tests { let exercises = [ Exercise { name: "1", - path: Path::new("exercises/1.rs"), + path: "exercises/1.rs", mode: Mode::Run, hint: String::new(), done: true, }, Exercise { name: "2", - path: Path::new("exercises/2.rs"), + path: "exercises/2.rs", mode: Mode::Test, hint: String::new(), done: false, |
