| ▲ | Dylan16807 2 hours ago | |||||||
Some call points to a function that returns a Result will never return an Error. Some call points to a function that returns an int will never return -2. Sometimes you know things the type system does not know. | ||||||||
| ▲ | Rohansi 2 hours ago | parent [-] | |||||||
The difference is functions which return Result have explicitly chosen to return a Result because they can fail. Sure, it might not fail in the current implementation and/or configuration, but that could change later and you might not know until it causes problems. The type system is there to help you - why ignore it? | ||||||||
| ||||||||