Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mitghi committed Mar 11, 2023
1 parent 2460060 commit 17af201
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,21 @@ pub struct Path;
#[derive(Debug)]
pub struct PathResult(pub PathOutput);

/// Either contains either left or right value.
enum Either<A, B> {
Left(A),
Right(B),
}

/// Sum either contains left parameter or
/// upgrades permanentely to the type of
/// right parameter when addition of both
/// types take place.
struct Sum(Either<i64, f64>);

impl Sum {
fn new() -> Self {
// initially, use zero value of left parameter
Self(Either::Left(0))
}

Expand Down

0 comments on commit 17af201

Please sign in to comment.