Have new_with_stack impls return io::Result.

This commit is contained in:
Peter Huene
2021-03-03 13:27:56 -08:00
parent 4e83392070
commit 5ee2b8742a
3 changed files with 6 additions and 6 deletions

View File

@@ -75,7 +75,7 @@ impl Fiber {
Ok(fiber)
}
pub fn new_with_stack<F, A, B, C>(top_of_stack: *mut u8, func: F) -> Self
pub fn new_with_stack<F, A, B, C>(top_of_stack: *mut u8, func: F) -> io::Result<Self>
where
F: FnOnce(A, &super::Suspend<A, B, C>) -> C,
{
@@ -86,7 +86,7 @@ impl Fiber {
fiber.init(func);
fiber
Ok(fiber)
}
fn init<F, A, B, C>(&self, func: F)