From c98db054d5e940ada76dbdc855925cfc2f6e7ee8 Mon Sep 17 00:00:00 2001 From: Erik Grinaker Date: Sat, 4 May 2024 11:52:49 +0200 Subject: [PATCH] command: mark `Block`, `Command`, and `Argument` as `non_exhaustive` --- CHANGELOG.md | 5 +++++ src/command.rs | 3 +++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71762ca..d5d75b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Unreleased +Backwards-incompatible changes: + +* Mark `Command` and `Argument` as `non_exhaustive`, to allow extending them + in the future. + Bug fixes: * Relax dependency version requirements (was tilde requirements). \ No newline at end of file diff --git a/src/command.rs b/src/command.rs index a525478..17f495d 100644 --- a/src/command.rs +++ b/src/command.rs @@ -1,5 +1,6 @@ /// A block, consisting of multiple commands. #[derive(Debug, PartialEq)] +#[non_exhaustive] pub(crate) struct Block { /// The commands in the block. pub commands: Vec, @@ -9,6 +10,7 @@ pub(crate) struct Block { /// A command. #[derive(Debug, PartialEq)] +#[non_exhaustive] pub struct Command { /// The name of the command. Never empty. pub name: String, @@ -23,6 +25,7 @@ pub struct Command { /// A command argument. #[derive(Debug, PartialEq)] +#[non_exhaustive] pub struct Argument { /// The argument key, for `key=value` style arguments. Not guaranteed to be /// unique, the [`Runner`](crate::Runner) can handle this as desired.