Add completion to turn x.err into Err(x)
@@ -180,7 +180,24 @@ pub(crate) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) {
)
.add_to(acc);
- postfix_snippet(ctx, cap, &dot_receiver, "ok", "Ok(expr)", &format!("Ok({})", receiver_text))
+ postfix_snippet(
+ ctx,
+ cap,
+ &dot_receiver,
+ "ok",
+ "Ok(expr)",
+ &format!("Ok({})", receiver_text)
+ )
+ .add_to(acc);
+
+ postfix_snippet(
+ ctx,
+ cap,
+ &dot_receiver,
+ "err",
+ "Err(expr)",
+ &format!("Err({})", receiver_text)
+ )
.add_to(acc);
postfix_snippet(
