mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-22 09:24:26 +01:00
core/types: add IOResult::is_io() helper
This commit is contained in:
@@ -2466,6 +2466,12 @@ pub enum IOResult<T> {
|
||||
IO,
|
||||
}
|
||||
|
||||
impl<T> IOResult<T> {
|
||||
pub fn is_io(&self) -> bool {
|
||||
matches!(self, IOResult::IO)
|
||||
}
|
||||
}
|
||||
|
||||
/// Evaluate a Result<IOResult<T>>, if IO return IO.
|
||||
#[macro_export]
|
||||
macro_rules! return_if_io {
|
||||
|
||||
Reference in New Issue
Block a user