simplify TCResult to just two values

This commit is contained in:
Dustin J. Mitchell
2022-02-01 00:46:04 +00:00
parent b675cef99c
commit 22a6857c1b
6 changed files with 77 additions and 61 deletions

View File

@@ -1,11 +1,9 @@
// TODO: make true = 1, false = 0, error = -1
/// A result combines a boolean success value with
/// an error response. It is equivalent to `Result<bool, ()>`.
/// A result from a TC operation. Typically if this value is TC_RESULT_ERROR,
/// the associated object's `tc_.._error` method will return an error message.
/// cbindgen:prefix-with-name
/// cbindgen:rename-all=ScreamingSnakeCase
#[repr(C)]
#[repr(i32)]
pub enum TCResult {
Error = -1,
False = 0,
True = 1,
Ok = 0,
}