|
|
|
|
|
by pdevr
23 days ago
|
|
It is a feature in Rust, not a bug :-) (I know you didn't say it is a bug.) The error-tagged union is PgResult<bool> - which means it contains bool as the result if things go well. (The other part in the union is of course the error.) In the original function also, it is returning a boolean: "bool has_subclass". So anyway you have to check for the boolean as part of the logic. That is what it is doing. |
|
Edit: Looking at the code again, perhaps I was mistaken, since the boolean might not have been for error handling, just the result of the function, and C's limitations regarding error handling led it to using something like elog(), apparently a macro defined in https://github.com/postgres/postgres/blob/master/src/include... .