diff --git a/CHANGELOG.md b/CHANGELOG.md index 2645c59..d9b632c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,3 +55,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 and install Linux Swift toolchain prerequisites for the WASM CI job. - Harden duplicate-key validation to use set membership while preserving exact diagnostics. +- Make validation rules immutable after construction. diff --git a/Sources/Validation/Rule.swift b/Sources/Validation/Rule.swift index f4c46e9..f695b82 100644 --- a/Sources/Validation/Rule.swift +++ b/Sources/Validation/Rule.swift @@ -1,9 +1,9 @@ public extension PureYAML.Validation { /// A validation rule that can report zero or more path-aware issues. struct Rule: Sendable { - public var description: String - public var predicate: @Sendable (Context) -> Bool - public var check: @Sendable (Context) -> [Issue] + public let description: String + public let predicate: @Sendable (Context) -> Bool + public let check: @Sendable (Context) -> [Issue] public init( description: String,