Skip to content

Commit f4757b8

Browse files
committed
Version 0.4.4
Add `#[serde(default)]` to new AppConfig field
1 parent 52f8c5d commit f4757b8

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "objdiff"
3-
version = "0.4.3"
3+
version = "0.4.4"
44
edition = "2021"
55
rust-version = "1.65"
66
authors = ["Luke Street <[email protected]>"]

src/app.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,38 @@ pub struct ObjectConfig {
5454
#[inline]
5555
fn bool_true() -> bool { true }
5656

57+
#[inline]
58+
fn default_watch_patterns() -> Vec<Glob> {
59+
DEFAULT_WATCH_PATTERNS.iter().map(|s| Glob::new(s).unwrap()).collect()
60+
}
61+
5762
#[derive(Clone, serde::Deserialize, serde::Serialize)]
5863
pub struct AppConfig {
5964
// TODO: https://github.com/ron-rs/ron/pull/455
6065
// #[serde(flatten)]
6166
// pub version: AppConfigVersion,
6267
pub version: u32,
68+
#[serde(default)]
6369
pub custom_make: Option<String>,
70+
#[serde(default)]
6471
pub selected_wsl_distro: Option<String>,
72+
#[serde(default)]
6573
pub project_dir: Option<PathBuf>,
74+
#[serde(default)]
6675
pub target_obj_dir: Option<PathBuf>,
76+
#[serde(default)]
6777
pub base_obj_dir: Option<PathBuf>,
78+
#[serde(default)]
6879
pub selected_obj: Option<ObjectConfig>,
80+
#[serde(default)]
6981
pub build_target: bool,
7082
#[serde(default = "bool_true")]
7183
pub rebuild_on_changes: bool,
84+
#[serde(default)]
7285
pub auto_update_check: bool,
86+
#[serde(default = "default_watch_patterns")]
7387
pub watch_patterns: Vec<Glob>,
88+
#[serde(default)]
7489
pub recent_projects: Vec<PathBuf>,
7590

7691
#[serde(skip)]

0 commit comments

Comments
 (0)