mirror of https://github.com/encounter/objdiff.git
Version 0.4.4
Add `#[serde(default)]` to new AppConfig field
This commit is contained in:
parent
52f8c5d4f9
commit
f4757b8d92
|
@ -2457,7 +2457,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "objdiff"
|
name = "objdiff"
|
||||||
version = "0.4.3"
|
version = "0.4.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"byteorder",
|
"byteorder",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "objdiff"
|
name = "objdiff"
|
||||||
version = "0.4.3"
|
version = "0.4.4"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.65"
|
rust-version = "1.65"
|
||||||
authors = ["Luke Street <luke@street.dev>"]
|
authors = ["Luke Street <luke@street.dev>"]
|
||||||
|
|
15
src/app.rs
15
src/app.rs
|
@ -54,23 +54,38 @@ pub struct ObjectConfig {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn bool_true() -> bool { true }
|
fn bool_true() -> bool { true }
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
fn default_watch_patterns() -> Vec<Glob> {
|
||||||
|
DEFAULT_WATCH_PATTERNS.iter().map(|s| Glob::new(s).unwrap()).collect()
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clone, serde::Deserialize, serde::Serialize)]
|
#[derive(Clone, serde::Deserialize, serde::Serialize)]
|
||||||
pub struct AppConfig {
|
pub struct AppConfig {
|
||||||
// TODO: https://github.com/ron-rs/ron/pull/455
|
// TODO: https://github.com/ron-rs/ron/pull/455
|
||||||
// #[serde(flatten)]
|
// #[serde(flatten)]
|
||||||
// pub version: AppConfigVersion,
|
// pub version: AppConfigVersion,
|
||||||
pub version: u32,
|
pub version: u32,
|
||||||
|
#[serde(default)]
|
||||||
pub custom_make: Option<String>,
|
pub custom_make: Option<String>,
|
||||||
|
#[serde(default)]
|
||||||
pub selected_wsl_distro: Option<String>,
|
pub selected_wsl_distro: Option<String>,
|
||||||
|
#[serde(default)]
|
||||||
pub project_dir: Option<PathBuf>,
|
pub project_dir: Option<PathBuf>,
|
||||||
|
#[serde(default)]
|
||||||
pub target_obj_dir: Option<PathBuf>,
|
pub target_obj_dir: Option<PathBuf>,
|
||||||
|
#[serde(default)]
|
||||||
pub base_obj_dir: Option<PathBuf>,
|
pub base_obj_dir: Option<PathBuf>,
|
||||||
|
#[serde(default)]
|
||||||
pub selected_obj: Option<ObjectConfig>,
|
pub selected_obj: Option<ObjectConfig>,
|
||||||
|
#[serde(default)]
|
||||||
pub build_target: bool,
|
pub build_target: bool,
|
||||||
#[serde(default = "bool_true")]
|
#[serde(default = "bool_true")]
|
||||||
pub rebuild_on_changes: bool,
|
pub rebuild_on_changes: bool,
|
||||||
|
#[serde(default)]
|
||||||
pub auto_update_check: bool,
|
pub auto_update_check: bool,
|
||||||
|
#[serde(default = "default_watch_patterns")]
|
||||||
pub watch_patterns: Vec<Glob>,
|
pub watch_patterns: Vec<Glob>,
|
||||||
|
#[serde(default)]
|
||||||
pub recent_projects: Vec<PathBuf>,
|
pub recent_projects: Vec<PathBuf>,
|
||||||
|
|
||||||
#[serde(skip)]
|
#[serde(skip)]
|
||||||
|
|
Loading…
Reference in New Issue