Skip to content

Commit 456b597

Browse files
authored
chore: add Result type alias and Ok function for convenience (#78)
1 parent 0c8740c commit 456b597

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/errors.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,10 @@ pub enum Error {
5050
var_debug: String,
5151
},
5252
}
53+
54+
pub type Result<T> = core::result::Result<T, Error>;
55+
56+
/// Construct an `Ok` value of type `Result<T, sigma_rs::errors::Error>`.
57+
pub const fn Ok<T>(value: T) -> Result<T> {
58+
Result::Ok(value)
59+
}

0 commit comments

Comments
 (0)