Open adamchalmers opened 2 weeks ago
@rustbot claim
In some cases we offer these as diagnostic quick fixes:
let x: Option<i32> = 42; // Wrap in Some
let x: i32 = Some(42); // no Unwrap available
let x: Result<i32, ()> = 42; // Wrap in Ok
let x: i32 = Ok(42); // No Unwrap available
Given that, I'm not sure we need another assist.
I'll look into adding an equivalent unwrap fix to that diagnostic
I frequently find myself refactoring code and needing to either add or remove a
Some()
wrapper from an expression. Similar need forOk()
andErr()
. It'd be great if Rust Analyzer had an action to add or remove these wrappers.I can approximate this somewhat with macros of key sequences in my editor, but it'd be neat if RA could do it :)