#Return result/option from a system

5 messages · Page 1 of 1 (latest)

bold mason
#

Is it possible to return result or option from a system? i want it use mostly for the ? syntax. When I try to do that I get "trait not satisfied" error on adding the system

rich coral
vivid sky
#

There's also a bevy sys fail crate to add sugar

sleek wraith
#

Also there is the traditional approach

(|| -> Result<A, B> {
   f1()?;
   f2()?;
   Ok(f3()?) 
})().unwrap()
bold mason
#

Thank you guys! ❤️