Skip to content

Commit

Permalink
Clarify intention that option is Some in code
Browse files Browse the repository at this point in the history
The debug_assert adds a stronger signal that the option must be Some when it is being constructed.
  • Loading branch information
schneems committed Jan 18, 2024
1 parent aa8898d commit 47ac797
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions libherokubuildpack/src/output/background.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,13 @@ pub(crate) mod state {
{
/// Preserve internal state by ensuring the `Option` is always populated
pub(crate) fn new(join_handle: JoinHandle<W>, sender: Sender<()>) -> Self {
PrintGuard {
let guard = PrintGuard {
join_handle: Some(join_handle),
stop_signal: sender,
}
};
debug_assert!(guard.join_handle.is_some());

guard
}

/// The only thing a consumer can do is stop the dots and receive
Expand Down

0 comments on commit 47ac797

Please sign in to comment.