lemmy icon indicating copy to clipboard operation
lemmy copied to clipboard

Cleanup all `Result<bool, Error>`, into `Result<(), Error>`

Open dessalines opened this issue 1 year ago • 0 comments

Requirements

  • [X] Is this a feature request? For questions or discussions use https://lemmy.ml/c/lemmy_support
  • [X] Did you check to see if this issue already exists?
  • [X] Is this only a feature request? Do not put multiple feature requests in one issue.
  • [X] Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.
  • [X] Do you agree to follow the rules in our Code of Conduct?

Is your proposal related to a problem?

This is a maintenance task to clean up all or most Result<bool, Error> , into Result<(), Error.

For all these, we only need to care about 2 cases out of the 3:

  • Ok and Err, not
  • Ok(true), Ok(false), and Error

Since we only care about the Some(true) case, and not the Some(false) case, this could lead to some code problems.

Describe the solution you'd like.

See above

Describe alternatives you've considered.

NA

Additional context

https://github.com/LemmyNet/lemmy/pull/4860#discussion_r1649389837

dessalines avatar Jun 21 '24 21:06 dessalines