You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In LepTess::set_image, bool is used as a return value to indicate success or failure. Booleans are not a good choice for a return value for this use case. Better is Option<()> or Result<(), ()> (I personally think Option<()> is nicer, but Result<(), ()> objectively makes more sense)
As a side-effect of this, the code inside the functions can become much more concise and idiomatic:
In LepTess::set_image,
bool
is used as a return value to indicate success or failure. Booleans are not a good choice for a return value for this use case. Better isOption<()>
orResult<(), ()>
(I personally thinkOption<()>
is nicer, butResult<(), ()>
objectively makes more sense)As a side-effect of this, the code inside the functions can become much more concise and idiomatic:
kangalio@786a751
The text was updated successfully, but these errors were encountered: