Skip to content

Commit

Permalink
command: mark Block, Command, and Argument as non_exhaustive
Browse files Browse the repository at this point in the history
  • Loading branch information
erikgrinaker committed May 4, 2024
1 parent b689f86 commit c98db05
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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).
3 changes: 3 additions & 0 deletions src/command.rs
Original file line number Diff line number Diff line change
@@ -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<Command>,
Expand All @@ -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,
Expand All @@ -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.
Expand Down

0 comments on commit c98db05

Please # to comment.