logoalt Hacker News

queoahfhtoday at 8:11 AM1 replyview on HN

From what I skimmed manually, not that many, but the code itself seems labyrinthical. Like, why have both Rust Try-supporting Error-like tagged union, but also booleans, for error handling, in the same function?

https://github.com/malisper/pgrust/blob/3646a73515a5e4ac7d0b...

https://github.com/malisper/pgrust/blob/3646a73515a5e4ac7d0b...


Replies

malispertoday at 9:29 AM

I'm not sure what you mean? The rust code you're showing mimics the Postgres code: https://github.com/postgres/postgres/blob/2e6578292a9184dcaa...

The boolean being returned is the return value of the function. It's not used to return an error.

show 2 replies