arn-the-long-beard / seed-routing

Prototype for having easy routing to use in Seed
MIT License
6 stars 2 forks source link

refactor: `Option<Route>` for forward/back functions #6

Closed Ben-PH closed 3 years ago

Ben-PH commented 3 years ago

Instead of can_forward() -> bool and can_forward_with_route() -> Option<Route>, we combine it into peek_forward() -> Option<Route>

forward() and back() also change from bool to Option<Route> in a similar manner.

This commit includes a documentation update linking to the corresponding peek function in the forward and back function, updated relevant tests, which also got a few additional asserts to cover more pre and post-conditions.

arn-the-long-beard commented 3 years ago

Thank you very much. Your new proposal is very handy to use and the code get simpler.

I merge it :smile:

Good job :+1: