Skip to content

Commit

Permalink
refactor!: rename Status::is_{terminal,settled}
Browse files Browse the repository at this point in the history
Some statuses really are "terminal", insofar as no operations can be
performed on the stack other than to delete it. We would like to start
identifying those statuses, and "terminal" is the best name for them.

A better name for statuses indicating that a stack operation has settled
is a "settled" status.

BREAKING CHANGE: `Status::is_terminal` has been replaced by
`Status::is_settled`.
  • Loading branch information
connec committed Nov 6, 2022
1 parent e34e87b commit 4b07082
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ impl StackEvent {
resource_status, ..
} = self
{
resource_status.is_terminal()
resource_status.is_settled()
} else {
false
}
Expand Down
12 changes: 6 additions & 6 deletions src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

/// Common operations for statuses.
pub trait Status: std::fmt::Debug + std::fmt::Display + private::Sealed {
/// Indicates whether or not a status is terminal.
/// Indicates whether or not a status is settled.
///
/// A terminal status is one that won't change again during the current stack operation.
fn is_terminal(&self) -> bool;
/// A settled status is one that won't change again during the current stack operation.
fn is_settled(&self) -> bool;

/// Indicates the sentiment of the status.
///
Expand Down Expand Up @@ -61,7 +61,7 @@ pub enum ChangeSetStatus {
}

impl Status for ChangeSetStatus {
fn is_terminal(&self) -> bool {
fn is_settled(&self) -> bool {
match self {
Self::CreatePending
| Self::CreateInProgress
Expand Down Expand Up @@ -112,7 +112,7 @@ pub enum StackStatus {
}

impl Status for StackStatus {
fn is_terminal(&self) -> bool {
fn is_settled(&self) -> bool {
match self {
Self::CreateInProgress
| Self::RollbackInProgress
Expand Down Expand Up @@ -190,7 +190,7 @@ pub enum ResourceStatus {
}

impl Status for ResourceStatus {
fn is_terminal(&self) -> bool {
fn is_settled(&self) -> bool {
match self {
Self::CreateInProgress
| Self::DeleteInProgress
Expand Down

0 comments on commit 4b07082

Please sign in to comment.