Skip to content

[config] MetricsConfig missing #[serde(deny_unknown_fields)] — typos accepted silently #221

@obchain

Description

@obchain

Refs #50

File: crates/charon-core/src/config.rs (MetricsConfig)

Problem

MetricsConfig struct in config.rs does not have #[serde(deny_unknown_fields)]. Project convention from PR #29 (issue #81) is deny_unknown_fields on every config struct so typos surface as parse errors instead of silent defaults.

Fix

#[derive(Debug, Clone, Deserialize)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct MetricsConfig {
    #[serde(default = "default_metrics_enabled")]
    pub enabled: bool,
    #[serde(default = "default_metrics_bind")]
    pub bind: String,
}

Add #[non_exhaustive] in same change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlayer:rustRust crates (core / scanner / protocols / executor / cli)pr-reviewFindings from PR review processpriority:p2-polishNice-to-have / polishstatus:readyScoped and ready to pick up

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions