rough-minister-58256
05/30/2018, 10:24 PMaverage-vr-56795
05/31/2018, 9:16 AMFrom
stuff is coolest for error types with the ?
operator:
fn do_something() -> Result<String, String> {
Err("foo".to_owned())
}
fn foo() -> Result<String, MyError> {
do_something()?
}
will Just Work with no .into()
call because the ?
operator will automatically call .into()
if neededaverage-vr-56795
05/31/2018, 9:17 AM.into()
, I’m slightly torn about whether I like its implicit magic, or whether I want to be more explicit.average-vr-56795
05/31/2018, 9:18 AMlet foo: hashing::Digest = bar.into()
) because the inference can’t work out what type should be `into`’d to without that, which makes me sadaloof-angle-91616
05/31/2018, 2:33 PMwitty-crayon-22786
05/31/2018, 2:35 PMaverage-vr-56795
05/31/2018, 2:35 PMaloof-angle-91616
05/31/2018, 2:36 PMwitty-crayon-22786
05/31/2018, 2:41 PMfs/src/lib.rs
is small enough now that it doesn't autocollapse!)aloof-angle-91616
05/31/2018, 2:48 PMaverage-vr-56795
05/31/2018, 3:38 PMaverage-vr-56795
05/31/2018, 3:39 PMaverage-vr-56795
05/31/2018, 3:39 PMwitty-crayon-22786
05/31/2018, 4:00 PMwitty-crayon-22786
05/31/2018, 4:01 PMaverage-vr-56795
06/01/2018, 2:14 PMaverage-vr-56795
06/01/2018, 3:01 PMaverage-vr-56795
06/01/2018, 3:01 PMenough-analyst-54434
06/01/2018, 3:46 PMenough-analyst-54434
06/01/2018, 3:47 PMenough-analyst-54434
06/01/2018, 3:47 PMaverage-vr-56795
06/01/2018, 3:47 PMenough-analyst-54434
06/01/2018, 3:49 PMaverage-vr-56795
06/01/2018, 3:50 PMaverage-vr-56795
06/01/2018, 3:50 PMrun
goal for a jvm targetenough-analyst-54434
06/01/2018, 3:50 PMaverage-vr-56795
06/01/2018, 3:51 PMenough-analyst-54434
06/01/2018, 3:51 PMenough-analyst-54434
06/01/2018, 3:51 PMenough-analyst-54434
06/01/2018, 3:52 PM