Skip to content

Commit 078b9da

Browse files
author
Antonio Bennett
committed
Fix: Add serde default for enable_rust_crates to handle legacy configs
- Ensures missing field in old leetcode.toml defaults to true without error. - Improves backward compatibility.
1 parent 2ed647f commit 078b9da

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/config/code.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ pub struct Code {
3838
pub comment_leading: String,
3939
#[serde(default, skip_serializing)]
4040
pub test: bool,
41-
pub enable_rust_crates: bool,
41+
#[serde(default = "default_enable_rust_crates")]
42+
pub enable_rust_crates: bool,
4243
pub lang: String,
4344
#[serde(default = "default_pick", skip_serializing)]
4445
pub pick: String,

0 commit comments

Comments
 (0)